Community Profile

photo

Stephen Cobeldick


Last seen: Today
6.674 total contributions since 2014

Suspensa Vix Via Fit

Stephen Cobeldick's Badges

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

View details...

Contributions in
View by

Answered
Not enough input arguments
Exactly as the pdepe documentation explains (and its examples show) you need to provide three function handles as its 2nd, 3rd, ...

ein Tag ago | 0

| accepted

Answered
How to convert a char letter into a double which is still a letter.
The simple MATLAB approach is to use the character code: >> double('t') ans = 116

2 Tage ago | 0

Answered
Apply a customized function to cell array
D = cellfun(@RemoveZeroColumnsInCSImatrix, C, 'UniformOutput',false);

2 Tage ago | 0

| accepted

Submitted


Number to Scientific Prefix
Convert a numeric value to an metric prefixed string (SI/engineering). Bonus: binary prefixes!

2 Tage ago | 9 downloads |

Thumbnail

Submitted


Scientific Prefix to Number
Convert a metric prefixed string into numeric value (SI/engineering). Bonus: binary prefixes!

2 Tage ago | 6 downloads |

Thumbnail

Answered
Reading image in zig zag, and arrange the output matrix in ascending and descending issue
>> A = [5,13;7,13;6,13;4,14;5,14;8,14;5,16;8,16;7,16;9,16;3,20;6,20;8,20;9,20] A = 5 13 7 13 6 13 4 ...

3 Tage ago | 0

| accepted

Submitted


Words to Number
Convert English number name/s in a string to numeric value/s (GB/US).

3 Tage ago | 2 downloads |

Thumbnail

Submitted


Number to Words
Convert a number to a string giving the English name of the number value (GB/IN/US).

3 Tage ago | 3 downloads |

Thumbnail

Submitted


Number to Myriad
Convert a number to a string giving the value using Knuth's Myriad/Yllion naming scheme.

3 Tage ago | 1 download |

Thumbnail

Submitted


Numeric to Ordinal-String
Convert numeric values to a character array of integers with ordinal suffixes. Fully vectorized!

3 Tage ago | 6 downloads |

Thumbnail

Answered
How to replace leading zeroes by spaces with regexprep
>> fun = @(c)regexprep(c,'^0+(?=\d)','${char(double($&)-16)}'); >> out = varfun(fun,T) out = Fun_a Fun_b Fun_c ...

3 Tage ago | 1

| accepted

Answered
Open multiple .csv files, process and save them in a structure
You need to fix this line otherwise your loop will only iterate once: for i = 1:length(filename) % ^ this must be a col...

4 Tage ago | 0

| accepted

Answered
Shuffling numbers while keeping identical numbers next to each other
>> A = [1,1,2,3,3,4,6,6,6,6]; >> X = diff(find([1,diff(A),1])); >> C = mat2cell(A,1,X); >> Y = randperm(numel(C)); >> V = [C...

4 Tage ago | 1

| accepted

Answered
Dynamic call to structure elements
You can trivially access the fields of a structure using this syntax, where F is the fieldname: S.(F) See: https://www.mathwor...

5 Tage ago | 0

Answered
MATLAB example not working.
Typical reasons why that function might not work: scatteringchanmtx was introduced in R2017b. It will not work with earlier MAT...

5 Tage ago | 0

| accepted

Answered
How to use varargin and varargout?
As their documentation explains, both varargin and varargout are cell arrays. So if required (e.g. to perform numeric operations...

6 Tage ago | 0

| accepted

Answered
Data types of arrays in a function
B = int8(A); if any(B(:)~=A(:)) B = A; end Note that this is a more versatile approach because it does not use hard-code...

6 Tage ago | 0

Answered
Merge specific text files
You will need two loops, the outer loop for M1, M2, etc, and the inner loop for the files R1,R2,R3,...R100, e.g.: D = 'path to...

6 Tage ago | 0

| accepted

Answered
Who could get all the data in the attached file by the matlab?
>> rgx = '([-+]?\d+\.?\d*([eE][-+]?\d+)?)'; >> str = fileread('tem-001.txt'); >> tkn = regexp(str,[rgx,'\s+',rgx],'tokens'); ...

6 Tage ago | 0

| accepted

Answered
Trying to create a set of matrixes using a for loop. I have an error on line 23: Array indices must be positive integers or logical values. Basically making matrixes labeled ke1, ke2, ke3...
There are multiple issues with your loop: you are attempting to use invalid indices (e.g. 0, pi/2, etc.). you are providing fo...

9 Tage ago | 1

| accepted

Answered
i have a variable in my workspace and i dont know its name directly
Do not load directly into the workspace, always load into an output variable (which is a scalar structure): S = load(...); The...

10 Tage ago | 0

Answered
Extract number and infromation from multiple image files ?
One simple regular expression does this quite efficiently: D = 'Defolder'; S = dir(fullfile(D,'*.jpg')); N = {S.name}; T = r...

12 Tage ago | 1

Answered
Add lines (data) to a fopen file without overwriting the previous data
Try the append option: https://www.mathworks.com/help/matlab/ref/fopen.html#btrnibn-1-permission NS = fopen(... ,'a+'); % ...

14 Tage ago | 0

| accepted

Answered
How to find minimum value from loop using if function iteration?
>> a = 135500; >> dx = 1000; >> b = floor(a/dx) b = 135

14 Tage ago | 0

| accepted

Answered
How to sort folders in imageDatastore?
https://www.mathworks.com/matlabcentral/answers/416241-how-to-sort-the-files-obtained-by-imagedatastore

14 Tage ago | 0

Answered
Why I the data processed by the matlab is wrong, it reports three wrong results,what is the reason?All the data and .m files are included ,who can help me?
opt = {'CollectOutput',true }; [fid,msg] = fopen('tem-009.out','rt'); assert(fid>=3,msg) str = ''; while ~strncmp(str,'-',1)...

17 Tage ago | 0

Answered
For loop in function handle
You can simply store function handles in a cell array of any size and use cellfun. No loop required. >> C = {@sin,@sqrt,@pow2};...

18 Tage ago | 1

Answered
Changing elements of vector with matrix
No loop required: >> v = 1:numel(a); >> x = any(v>=b(:,1) & v<=b(:,2), 1); % requires MATLAB >=R2016b >> a(x) = 1 a = 1 ...

19 Tage ago | 1

| accepted

Answered
Merge files with the same prefix.
This should get you started (untested, but gives an outline of how you could do this): D = 'path to the folder where the files ...

19 Tage ago | 0

| accepted

Answered
How to sort one array based on another of a different size
As Rik wrote, the MATLAB solution is to use ismember, e.g.: >> A = {'a','a','b','c','c','d','d','d','d','e','e'}; >> B = {'d',...

19 Tage ago | 1

| accepted

Load more