Community Profile

photo

Stephen Cobeldick


Last seen: Today
7 372 total contributions since 2014

Suspensa Vix Via Fit

Stephen Cobeldick's Badges

  • Grand Master
  • Personal Best Downloads Level 4
  • Editor's Pick
  • First Review
  • 5-Star Galaxy Level 5
  • GitHub Submissions Level 3
  • First Submission
  • 36 Month Streak
  • Thankful Level 4
  • Revival Level 2
  • Knowledgeable Level 4
  • First Answer

View details...

Contributions in
View by

Answered
How do you load m-files that contain filenames with integers and strings?
"...is there a way to use the %d notation in the file names to make this process more efficent?" Of course, the documentation s...

environ 10 heures ago | 0

Answered
import file with exponential numbers
You are making this far more complex than it needs to be: M = readmatrix('1.txt')

1 jour ago | 1

| accepted

Answered
How to read data out of a .txt-File?
M = readmatrix('temp.txt','HeaderLines',18)

1 jour ago | 0

| accepted

Answered
Why matlab gives graph of exp(1/x) and exp(-1/x) wrong?
fun = @(x) exp(-1./x); fplot(fun) ylim([0,10]) fun = @(x) exp(1./x); fplot(fun) ylim([0,10]) I doubt there is much that ca...

2 jours ago | 0

| accepted

Submitted


Hyphenate
Word hyphenation using Franklin Mark Liang's algorithm (aka Knuth-Liang algorithm). Used in TeX.

2 jours ago | 4 downloads |

Thumbnail

Answered
Mean Value in a variables cell array
Where C is your cell array: N = size(C,1); M = nan(N,1); for k = 1:N M(k) = mean([C{k,:}]); end

2 jours ago | 0

| accepted

Answered
wilcard usage with strncmp
C = {'hello','* 2020','world','* 1923'}; X = ~cellfun(@isempty,regexp(C,'^\* \d{4}$')) D = C(X)

2 jours ago | 2

| accepted

Answered
Can't merge tables with error of weird array size limitation, help?
"I want to merge Table B into Table A (rows stay the same, only add the variables) and for identical variables want to keep the ...

3 jours ago | 0

| accepted

Answered
Checking whether string exist in a cell and read its ID
The simple, efficient MATLAB approach would be to use ISMEMBER: A = {'banana',12;'orange',23;'apple',35;'peach',74;'pear',51;'c...

4 jours ago | 2

| accepted

Answered
How to create a vector by indexing elements within each cell of a 1xN cell array
Where C is your cell array: a = ..; b = ..; F = @(m)m(a,b); V = cellfun(F,C)

4 jours ago | 0

| accepted

Answered
How can I read from a file (specific format) using Matlab?
str = fileread('temp.txt'); rgx = ':scurrent:(.+?):t:(.+?):c:(.+?):'; tkn = regexp(str,rgx,'tokens'); tkn = vertcat(tkn{:}) ...

5 jours ago | 0

Answered
All possible combination based on 2^n
n = 3; m = dec2bin(0:pow2(n)-1)-'0' % limited precision Or C = cell(1,n); [C{:}] = ndgrid(0:1); C = cellfun(@(a)a(:),C,'uni...

5 jours ago | 0

| accepted

Submitted


Customizable Natural-Order Sort
Alphanumeric sort of a cell/string/categorical array, with customizable numeric format.

5 jours ago | 61 downloads |

Thumbnail

Submitted


Natural-Order Filename Sort
Alphanumeric sort of filenames or filepaths, with customizable numeric format.

5 jours ago | 358 downloads |

Thumbnail

Submitted


Natural-Order Row Sort
Alphanumeric row sort of a cell/string/categorical array, with customizable numeric format.

5 jours ago | 19 downloads |

Thumbnail

Answered
Any value (different values) I enter for TOLERANCE and ITERATION gives the same results(Answer( . It is supposed to give different answers . I don't know why this is occurring.
tol = 0.001; n = 100; f = @(x) (x+1-2*sin(pi*x)); fplot(f,[0,0.5]) a = 0; b = 0.5; pre=0; for i = 1:n c = (a+b)/...

5 jours ago | 0

| accepted

Answered
I need to create two test and train folder from one parent folder (in the same directory), I wrote the code, but file couldn't be moved. Please Help!!
P = 'absolute/relative path to where the files are saved'; S = dir(fullfile(P,'*.jpg')); N = numel(files); B = randperm(N) > ...

6 jours ago | 1

| accepted

Answered
Using previous value to get the next in for loop
"But this makes my command window seemingly run forever." So far no one has actually addressed why your code is inefficient, in...

7 jours ago | 2

Answered
How to reshape a matrix (something that can't be done with reshape function)
A = [1,4,7,10;2,5,8,11;3,6,9,12] nmc = 2; % output number of columns nmr = 3; % output number of rows per "group" B = reshape...

7 jours ago | 0

| accepted

Submitted


Next Available Filename
Returns the next unused file or folder name. The name is created by incrementing a numbered suffix.

7 jours ago | 12 downloads |

Thumbnail

Answered
find all sequences between delimiters in an array
v = [1,1,0,2,0,2,1,2,1,1,1,0,2,1,2,0,0,1,1,1,1,1,1,2,1,0]; [begIdx,endIdx,~,match] = regexp(sprintf('%d',v),'2.*?0')

8 jours ago | 1

| accepted

Answered
User defined function that evaluates anonymous function with variable number of inputs
Your mistake was deciding to use eval, which is one way that beginners paint themselves into a corner with slow, inefficient, co...

8 jours ago | 0

Answered
Array indices must be positive integers or logical values
"every element is positive and >0" Nope: S = load('data_req.mat') find(S.IntOutAdr==0)

9 jours ago | 1

| accepted

Answered
Storage elements from matrix in other one, with indexing.
The MATLAB approach: A = [8,3,0,2;9,6,1,4;10,6,2,1;1,6,2,8] v = [2,4]; out = A(v,v)

9 jours ago | 1

Answered
Extend a string within a for loop by values from switch case
Forget about C. The MATLAB approach is to work with vectors and matrices (which is where the name MATLAB comes from): inp = 'A...

9 jours ago | 1

Answered
Control Dynamically Multi-Dimension Matrix on fprintf
A(:,:,1) = [1,2,4;5,2,1;6,2,1]; A(:,:,2) = [4,6,1;8,0,3;1,2,4]; A(:,:,3) = [5,8,2;4,4,4;1,0,0]; D = ndims(A); F = repmat(',%...

9 jours ago | 0

| accepted

Answered
Apply a change on all the double variables of a .mat file at once
"Do you have any idea on how I can apply a change on all the double variables of a .mat file at once." Easy: load into an outp...

11 jours ago | 0

Submitted


Interactive Regular Expression Tool
Develop and refine regular expressions in an interactive figure that shows all of REGEXP's outputs.

11 jours ago | 18 downloads |

Thumbnail

Answered
make a matrix from a structure field.
Where S is the name of your structure: out = vertcat(S.ch_nme2) https://www.mathworks.com/help/matlab/matlab_prog/comma-separa...

11 jours ago | 1

| accepted

Answered
Resolving Matrix dimensions must agree
Use strcmp or strcmpi to check if two text strings match or not: if strcmp(A,B) Alternatively you could use one switch stateme...

13 jours ago | 1

Load more