Answered
Displaying cells which have different sizes
for k= 1:size(Y,1) fprintf('#1 : %s GET--> %d\n', Y{k,1}, Y{k,2}) end

6 years ago | 0

Answered
the error"The function values at the interval endpoints must differ in sign" + fzero
fh = @(x) matlabFunction(eqn)

6 years ago | 0

Answered
How to write a For loop for the last characters vector names
Example: You could also use a table () for this. <https://www.mathworks.com/help/matlab/matlab_prog/generate-field-names-from-va...

6 years ago | 0

| accepted

Answered
what is the most efficient way to set several matrix values to zero ?
matrix(ismember(matrix, vec)) = 0

6 years ago | 1

| accepted

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

6 years ago | 0

| accepted

Answered
How to add arrays (horz. with different dimensions/size)
[array1, array2.']

6 years ago | 0

| accepted

Answered
Import CSV file and calculate
doc readtable

6 years 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=...

6 years 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>

6 years ago | 0

| accepted

Answered
How to cut out a string
regexp(s,'(?<=T\d{3}_).*', 'match') % s your string

6 years ago | 1

| accepted

Answered
how to resolve Transfer function error?
That function requires *Control System Toolbox* and a valid license for it.

6 years 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...

6 years ago | 0

| accepted

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); ...

6 years 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...

6 years 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...

6 years 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)]

6 years 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...

6 years 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.

6 years ago | 0

| accepted

Answered
trimming matrix arrays arranged within cell arrays
TrimmedArray = cellfun(@(x) x(1:10,:),CellArray,'un',0); celldisp(TrimmedArray)

6 years 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...

6 years 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...

6 years 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>

6 years 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 ...

6 years 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()

6 years ago | 1

| accepted

Answered
The legend of the plot doesn't appear
<https://www.mathworks.com/help/matlab/ref/legend.html#bu_szhx-1>

6 years ago | 0

Answered
Integrator error in simulink ?
Try reducing the step size as it suggests?

6 years 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

6 years 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.

6 years ago | 0

Load more