Community Profile

# Stephen Cobeldick

Last seen: Today 2014 이후 활성

Suspensa Vix Via Fit

All

배지보기

#### Content Feed

보기 기준

답변 있음
why "writetable" replaces points with commas ???
"why "writetable" replaces points with commas ???" It doesn't. The Open Office XML format (e.g. XLSX) uses only the decimal po...

약 15시간 전 | 0

답변 있음
'123' to 123
A = '123' A = str2double(A)

약 16시간 전 | 0

| 수락됨

답변 있음
Indexing a variable in a cell array?
strcmpi(txt2,date) But... you should be using READTABLE to import that file data, and handle those dates as DATETIME, not as ...

2일 전 | 0

답변 있음
Add variables calculated in a for loop into an array
I suspect that you need something like this: nml = numel(numbers); out = nan(nml,1); for k = 1:nml out(k) = calculate(nu...

2일 전 | 0

| 수락됨

답변 있음
How can I change the line color in a graph using plot
You are using MATLAB R2014a, which uses the old graphics system. That YouTube tutorial uses R2015b, which includes a totally ne...

2일 전 | 0

답변 있음
Why is x(:) so much slower than reshape(x,N,1) with complex arrays?
I hypothesize (without much proof) that colon (aka indexing) simply does a lot more under the hood. We can assume that it calls...

2일 전 | 0

답변 있음
Get number of fields? the result should be 14! I tried with size but it did not work!
"I tried with size but it did not work!" The size of a structure is completely independent of how many fields it has. To count...

2일 전 | 0

답변 있음
Select particular elements from a cell array to form a matrix (double type)
Simply: fun = @(x) x.endo_simul(17,1); out = cellfun(fun,results)

3일 전 | 1

답변 있음
What is the most correct way of determining whether variable contains a number
Let MATLAB do the heavy lifting for you: fun = @(x) isnumeric(x)&&isfinite(x) || isfinite(str2double(x)); fun(2.3) fun(NaN) ...

3일 전 | 0

제출됨

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

3일 전 | 다운로드 수: 7 |

답변 있음
How to create exportable table from outputs of function iterated using for loop?
If your function has four outputs then you need to call it with four outputs. This is explained in the introductory tutorials: ...

9일 전 | 0

| 수락됨

답변 있음
How to reshape 3D matrix ?
A = randi(9,4,4,3) B = permute(reshape(permute(A,[2,1,3]),[2,8,3]),[3,1,2])

9일 전 | 0

| 수락됨

답변 있음
This PDF file: https://www.mathworks.com/help/pdf_doc/matlab/matlab_apiref.pdf is listed here: https://www.mathworks.com/help...

9일 전 | 0

| 수락됨

답변 있음
Why is my loop not working?
Look closely at the variable a: a=0; for .. a=a+50; [b,a]=ellip(..[a 5000]..); .. end At the start of the fir...

9일 전 | 0

| 수락됨

답변 있음
Merge a row to a single cell
C = {... '1' '2' ':' '5' '7' ':' '0' '0' '1' '2' ':' '5' '7' ':' '0' '0' '1' '2' ':' '5' '7' ':' '0' '0' '1'...

10일 전 | 0

| 수락됨

답변 있음
The size of the indicated variable or array appears to be changing with each loop iteration. Commonly, this message appears because an array is growing by assignment or concat
h = 1; r = 0:h:20; z = 0:h:20; [rgrid,zgrid] = meshgrid(r,z); zgrid = flip(zgrid) Simpler, faster code: b2 = find(zgri...

11일 전 | 0

| 수락됨

답변 있음
What does this mean "No differences to display. The files are not identical, but the only differences are in end-of-line characters."
"Can anyone help me to understand the meaning? " When you look at those files then they are shown with lots of lines. You might...

14일 전 | 1

| 수락됨

답변 있음
How to include 'end' in a varibable to extract a subset of the original vector ?
"... if i want to define range before the definictiion of the vector..." You could use an anonymous function: rng = @(v)v(1:en...

14일 전 | 2

| 수락됨

답변 있음
Convert values in the cell to array using cell2mat
The robust approach: out = horzcat(output1{:})

14일 전 | 0

| 수락됨

답변 있음
How to store matrices in a cell from a loop?
Rather than lots of separate variables, use a comma-separated list to store the function outputs: https://www.mathworks.com/hel...

15일 전 | 0

| 수락됨

답변 있음
Function output produces double array while only a single value is expected
I would avoid all of those superfluous and inefficient type conversions and messing around with indexing into character arrays. ...

15일 전 | 1

| 수락됨

답변 있음
Read set of .dat files in for loop
https://www.mathworks.com/help/matlab/import_export/process-a-sequence-of-files.html P = 'absolute or relative path to where th...

15일 전 | 0

| 수락됨

답변 있음
How to count alternating ones and zeros in a matrix
v =[ 0 0 0 0 0 0; ... 1 1 0 1 1 0; ... 1 0 1 0 1 0; ... ...

15일 전 | 0

답변 있음
Round the elements column of the matrix to the same digit than it is in the other column
S = 2; A = 32*rand(5,7)-13 round(A(:,5),S,'significant') % for comparison P = S-1-floor(log10(abs(A(:,5)))); B = round(A.*10...

16일 전 | 0

답변 있음
how to combine datetime array with cell array for export?
T = table(A,B); writetable(T,...)

16일 전 | 1

| 수락됨

제출됨

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

16일 전 | 다운로드 수: 44 |

제출됨

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

16일 전 | 다운로드 수: 365 |

제출됨

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

16일 전 | 다운로드 수: 20 |

답변 있음
How to use "if statement" for different matrix?
The MATLAB approach is to use arrays and indexing, e.g. using one simple cell array: V = {[1,3,5;2,4,7];[1,2,5;2,4,6];[1,4,5;4,...

16일 전 | 0

답변 있음
Create month array?
D = datetime(2021,1,1):calmonths(1):datetime(2021,12,31) D.Format = 'MMM'

17일 전 | 0