Answered

Matrix dimensions must agree.

rando = randn(size(imgA)); % random phase initialization, put this line after imgA = ... size(imgA) should be b...

Matrix dimensions must agree.

rando = randn(size(imgA)); % random phase initialization, put this line after imgA = ... size(imgA) should be b...

1 day ago | 0

| accepted

Answered

How to add arrays (horz. with different dimensions/size)

[array1, array2.']

How to add arrays (horz. with different dimensions/size)

[array1, array2.']

1 day ago | 0

| accepted

Answered

Replace NaN values with median for each row

m = TablE{:,2:end}; ix = any(isnan(m),2); mix = m(ix,:); m1 = median(m(ix,:),2,'omitnan') .* isnan(m(ix,:)) m1(m1=...

Replace NaN values with median for each row

m = TablE{:,2:end}; ix = any(isnan(m),2); mix = m(ix,:); m1 = median(m(ix,:),2,'omitnan') .* isnan(m(ix,:)) m1(m1=...

1 day ago | 0

| accepted

Answered

How can I align the legends of a plot with a text box such that they are aligned vertically?

<https://www.mathworks.com/help/matlab/ref/legend.html#bu7fn5n-1>

How can I align the legends of a plot with a text box such that they are aligned vertically?

<https://www.mathworks.com/help/matlab/ref/legend.html#bu7fn5n-1>

1 day ago | 0

Answered

How to cut out a string

regexp(s,'(?<=T\d{3}_).*', 'match') % s your string

How to cut out a string

regexp(s,'(?<=T\d{3}_).*', 'match') % s your string

1 day ago | 1

| accepted

Answered

how to resolve Transfer function error?

That function requires *Control System Toolbox* and a valid license for it.

how to resolve Transfer function error?

That function requires *Control System Toolbox* and a valid license for it.

1 day ago | 0

Answered

how to import from a csv with a different file name?

<https://www.mathworks.com/help/matlab/import_export/process-a-sequence-of-files.html> See the last example to read multiple fil...

how to import from a csv with a different file name?

<https://www.mathworks.com/help/matlab/import_export/process-a-sequence-of-files.html> See the last example to read multiple fil...

1 day ago | 0

Answered

How to store matrix from each iteration of a for loop in a larger matrix?

[M, ReaL, ImaG] = deal(cell(n, 1); % n number of matrices for k = 1 : n M{k} = matrix; ReaL{k} = real(matrix); ...

How to store matrix from each iteration of a for loop in a larger matrix?

[M, ReaL, ImaG] = deal(cell(n, 1); % n number of matrices for k = 1 : n M{k} = matrix; ReaL{k} = real(matrix); ...

1 day ago | 0

Answered

Hold on Is not Working

figure(1) yyaxis left plot(values_x,y1) % different scaling will make them visible yyaxis right plot(v...

Hold on Is not Working

figure(1) yyaxis left plot(values_x,y1) % different scaling will make them visible yyaxis right plot(v...

1 day ago | 0

| accepted

Answered

How can I save the elements into a List with a For Loop

function[ rho,gs,hs,k_value ]= plott(a,b) numbers = [0.9,0.95,0.96,0.97,0.98,0.99,0.9977,0.9978,0.9979,0.998,0.999,1]; d...

How can I save the elements into a List with a For Loop

function[ rho,gs,hs,k_value ]= plott(a,b) numbers = [0.9,0.95,0.96,0.97,0.98,0.99,0.9977,0.9978,0.9979,0.998,0.999,1]; d...

1 day ago | 0

| accepted

Answered

How to create a two columns cell array from two different cells?

k = 1 : numel(vectors); Wanted = [num2cell(k(:)), num2cell(vectors(:), 2)]

How to create a two columns cell array from two different cells?

k = 1 : numel(vectors); Wanted = [num2cell(k(:)), num2cell(vectors(:), 2)]

1 day ago | 0

| accepted

Answered

Extract specific values from long list of tables contained in a .mat file

<https://www.mathworks.com/matlabcentral/answers/470287-how-can-i-concatenate-tables-vertically#answer_382000> V = cat(1, T...

Extract specific values from long list of tables contained in a .mat file

<https://www.mathworks.com/matlabcentral/answers/470287-how-can-i-concatenate-tables-vertically#answer_382000> V = cat(1, T...

1 day ago | 0

Answered

Concatenate arrays in loop

Save it as a cell instead of a 3D matrix since you say they are of different lengths.

Concatenate arrays in loop

Save it as a cell instead of a 3D matrix since you say they are of different lengths.

2 days ago | 0

| accepted

Answered

trimming matrix arrays arranged within cell arrays

TrimmedArray = cellfun(@(x) x(1:10,:),CellArray,'un',0); celldisp(TrimmedArray)

trimming matrix arrays arranged within cell arrays

TrimmedArray = cellfun(@(x) x(1:10,:),CellArray,'un',0); celldisp(TrimmedArray)

2 days ago | 0

Answered

Replace column with text element into integers

T = readtable('try.txt'); T(:,1) = regexprep(T{:,1},'''','') T.Var1 =(strcmp(T{:, 1},'pippo') * 1 + strcmp(T{:, 1},'plut...

Replace column with text element into integers

T = readtable('try.txt'); T(:,1) = regexprep(T{:,1},'''','') T.Var1 =(strcmp(T{:, 1},'pippo') * 1 + strcmp(T{:, 1},'plut...

2 days ago | 0

| accepted

Answered

MATLAB 2013 and MATLAB 2017

<https://www.mathworks.com/help/matlab/release-notes.html> You can check there for differences. One major update in *2017* is it...

MATLAB 2013 and MATLAB 2017

<https://www.mathworks.com/help/matlab/release-notes.html> You can check there for differences. One major update in *2017* is it...

2 days ago | 0

| accepted

Answered

How to open and read ncfile

<https://www.mathworks.com/help/matlab/ref/ncread.html#mw_9234a447-dfdd-42ed-a8e1-4e59aacb7100>

How to open and read ncfile

<https://www.mathworks.com/help/matlab/ref/ncread.html#mw_9234a447-dfdd-42ed-a8e1-4e59aacb7100>

2 days ago | 0

Answered

How can I get rid of notes in command window while running the fsolve

options = optimoptions('fsolve','Display','none'); % provide this as the third input argument to the solver doc fsolve % you ...

How can I get rid of notes in command window while running the fsolve

options = optimoptions('fsolve','Display','none'); % provide this as the third input argument to the solver doc fsolve % you ...

2 days ago | 0

| accepted

Answered

looping back to an input

c = input ('what is the cement ratio you require?'); % place this once again inside the if block after disp()

looping back to an input

c = input ('what is the cement ratio you require?'); % place this once again inside the if block after disp()

2 days ago | 1

| accepted

Answered

The legend of the plot doesn't appear

<https://www.mathworks.com/help/matlab/ref/legend.html#bu_szhx-1>

The legend of the plot doesn't appear

<https://www.mathworks.com/help/matlab/ref/legend.html#bu_szhx-1>

2 days ago | 0

Answered

Take an array of any numbers and search minimum number from them. You should have to use for loop for this.

Google bubble sort

Take an array of any numbers and search minimum number from them. You should have to use for loop for this.

Google bubble sort

2 days ago | 0

Answered

How can I use ginput coordinates in cumtrapz function and include this in a for loop?

trial = 3 : 14

How can I use ginput coordinates in cumtrapz function and include this in a for loop?

trial = 3 : 14

2 days ago | 0

Answered

num2str gives error as 'from struct to double conversion is not possible'

pdb= cell(1e3, 1); for ii = 1 : 1e3; pdb{ii} = pdbread(sprintf('%d.pdb', ii)); end

num2str gives error as 'from struct to double conversion is not possible'

pdb= cell(1e3, 1); for ii = 1 : 1e3; pdb{ii} = pdbread(sprintf('%d.pdb', ii)); end

2 days ago | 0

| accepted

Answered

how to use for loop along with ode45 to generate a series of plots

<https://www.mathworks.com/help/matlab/math/parameterizing-functions.html> after that loop through N.

how to use for loop along with ode45 to generate a series of plots

<https://www.mathworks.com/help/matlab/math/parameterizing-functions.html> after that loop through N.

2 days ago | 0

Answered

writetable - wrong number of arguments

<https://www.mathworks.com/help/matlab/ref/fullfile.html>

writetable - wrong number of arguments

<https://www.mathworks.com/help/matlab/ref/fullfile.html>

2 days ago | 1

| accepted

Answered

How to became my Tridiagonal matrix

[m, n] = size(B); ix = (1 : 2*m : n*2*m) + (0 : n - 1).'; Wanted = zeros(2*m - 1 , n); Wanted(ix) = B

How to became my Tridiagonal matrix

[m, n] = size(B); ix = (1 : 2*m : n*2*m) + (0 : n - 1).'; Wanted = zeros(2*m - 1 , n); Wanted(ix) = B

2 days ago | 0

Answered

Identify the minimum number of rows in a matrix meeting a condition

According to what I understood, see if this does what you want to do: [a, b] = unique(A, 'rows', 'stable'); s = sum(a, 2);...

Identify the minimum number of rows in a matrix meeting a condition

According to what I understood, see if this does what you want to do: [a, b] = unique(A, 'rows', 'stable'); s = sum(a, 2);...

2 days ago | 0

Answered

How to count number of days within datetime array

Use <https://www.mathworks.com/help/matlab/ref/timetable.retime.html;jsessionid=6ccf4bc9f13a49616ef1806d4311#bvdhiwr-method *ret...

How to count number of days within datetime array

Use <https://www.mathworks.com/help/matlab/ref/timetable.retime.html;jsessionid=6ccf4bc9f13a49616ef1806d4311#bvdhiwr-method *ret...

2 days ago | 0