Communication through MATLAB is always better than arguing.

Answered

How parentheses effects multiplication with pi ?

In the first the order of operation is from left to right. In the second the order of operation is inside the parenthesis and...

How parentheses effects multiplication with pi ?

In the first the order of operation is from left to right. In the second the order of operation is inside the parenthesis and...

environ 13 heures ago | 0

Answered

how to label strings in an array with an ID

T = cell2table(StringID(:, 2)); T.Properties.RowNames = StringID(:, 1); Wanted = T{num2cell(tc), :}

how to label strings in an array with an ID

T = cell2table(StringID(:, 2)); T.Properties.RowNames = StringID(:, 1); Wanted = T{num2cell(tc), :}

1 jour ago | 0

Answered

Error while plotting matrix of complex numbers

plot(real(sub), 'r-', imag(sub) ,'b*');

Error while plotting matrix of complex numbers

plot(real(sub), 'r-', imag(sub) ,'b*');

2 jours ago | 0

| accepted

Answered

Variable for loop storage

low = cell(numel(lowPs), 1); for k = 1 : numel(lowPs) B = A(:,1) == lowPs(k); %%row numbers in A where A(:,1) that co...

Variable for loop storage

low = cell(numel(lowPs), 1); for k = 1 : numel(lowPs) B = A(:,1) == lowPs(k); %%row numbers in A where A(:,1) that co...

2 jours ago | 0

| accepted

Answered

random matrix with a given number of specified elements

v = [repelem(1, 5), repelem(0, 4)]; Wanted = v(reshape(randperm(numel(v)), 3, []))

random matrix with a given number of specified elements

v = [repelem(1, 5), repelem(0, 4)]; Wanted = v(reshape(randperm(numel(v)), 3, []))

2 jours ago | 1

| accepted

Answered

How can I randomize the order of a matrix of images

Filenames = compose('image%d.png', 1:4); Filenames(randperm(numel(Filenames))) % ?

How can I randomize the order of a matrix of images

Filenames = compose('image%d.png', 1:4); Filenames(randperm(numel(Filenames))) % ?

2 jours ago | 0

Answered

wrong differential equation solution

a1 = matlabFunction(simplify(sol)); a = matlabFunction((1/80)*(36*exp(-t)-35*cos(t)-cos(3*t)+125*sin(t)-3*sin(3*t))); t ...

wrong differential equation solution

a1 = matlabFunction(simplify(sol)); a = matlabFunction((1/80)*(36*exp(-t)-35*cos(t)-cos(3*t)+125*sin(t)-3*sin(3*t))); t ...

4 jours ago | 1

Answered

Livescript: equation number

No, the workaround would be to use section titles.

Livescript: equation number

No, the workaround would be to use section titles.

4 jours ago | 0

| accepted

Answered

Why does the second matrix start with zeros?

MATLAB assigns zero to the previous indices, for better understanding: clear a a(11) = 1; % now you will see elements fro...

Why does the second matrix start with zeros?

MATLAB assigns zero to the previous indices, for better understanding: clear a a(11) = 1; % now you will see elements fro...

4 jours ago | 1

| accepted

Answered

How to remove array items that include a certain substring?

v = regexprep(filetable, '^[a,b].*', ''); v(cellfun('isempty', v)) = []

How to remove array items that include a certain substring?

v = regexprep(filetable, '^[a,b].*', ''); v(cellfun('isempty', v)) = []

5 jours ago | 0

Answered

Problem about rounding to 0

w = u_1 * u_2 - u_3 * sym(u_4) Click on the tag floating-point.

Problem about rounding to 0

w = u_1 * u_2 - u_3 * sym(u_4) Click on the tag floating-point.

6 jours ago | 1

Answered

How can I get maximum and minimum value with sym variables

Use matlabFunction() and fminbnd() to find the minimum value of that function and to find the maximum extreme use negative sign ...

How can I get maximum and minimum value with sym variables

Use matlabFunction() and fminbnd() to find the minimum value of that function and to find the maximum extreme use negative sign ...

6 jours ago | 0

| accepted

Answered

Sorting a matrix using it's index

Asort2 = A(sub2ind(size(A), repmat((1:size(A,1)).', 1, size(A,2)), idA))

Sorting a matrix using it's index

Asort2 = A(sub2ind(size(A), repmat((1:size(A,1)).', 1, size(A,2)), idA))

6 jours ago | 0

Answered

How to reshape matrix 2 columns by 2 columns

First = matrix(:, 1:2:end); Second = matrix(:, 2:2:end); Wanted = [First(:), Second(:)]

How to reshape matrix 2 columns by 2 columns

First = matrix(:, 1:2:end); Second = matrix(:, 2:2:end); Wanted = [First(:), Second(:)]

6 jours ago | 0

Answered

SUBS function not working properly - R2020a

double(val) %or vpa(val)

SUBS function not working properly - R2020a

double(val) %or vpa(val)

6 jours ago | 0

| accepted

Answered

Inserting a row in a matrix in a precise place

z = sortrows([A; b], 1); [b_logical, b_where] = ismember(b, z, 'rows')

Inserting a row in a matrix in a precise place

z = sortrows([A; b], 1); [b_logical, b_where] = ismember(b, z, 'rows')

6 jours ago | 1

Answered

Extract variable rows and columns from a matrix

A(sub2ind([nr, nc], rows, 1:nc))

Extract variable rows and columns from a matrix

A(sub2ind([nr, nc], rows, 1:nc))

7 jours ago | 0

| accepted

Answered

How to make a NaN vector if there is a single NaN in a column?

[m, n] = size(A); A = nan(m, any(isnan(A(:))) * n)

How to make a NaN vector if there is a single NaN in a column?

[m, n] = size(A); A = nan(m, any(isnan(A(:))) * n)

7 jours ago | 1

| accepted

Answered

How to assign values to an array with broadcasting

Your way of using repmat() is the easiest way.

How to assign values to an array with broadcasting

Your way of using repmat() is the easiest way.

7 jours ago | 0

| accepted

Answered

Error using 'Save' including quotation marks around variables

Use writematrix() or dlmwrite() or csvwrite() for older versions bearing in mind that filename = 'sample'; % for example

Error using 'Save' including quotation marks around variables

Use writematrix() or dlmwrite() or csvwrite() for older versions bearing in mind that filename = 'sample'; % for example

7 jours ago | 0

Answered

Find out how long after division will be an integer?

Simple use *mod()* doc mod

Find out how long after division will be an integer?

Simple use *mod()* doc mod

8 jours ago | 0

Answered

How can one create frequency table of two dimensional data?

[u, ~, c] = unique(data, 'rows', 'stable'); Wanted = [u, accumarray(c, 1)]

How can one create frequency table of two dimensional data?

[u, ~, c] = unique(data, 'rows', 'stable'); Wanted = [u, accumarray(c, 1)]

8 jours ago | 0

| accepted

Answered

how to skip plot in the legend when the number of plots is variable

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

how to skip plot in the legend when the number of plots is variable

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

8 jours ago | 0

Answered

How to pad cell w/ multiple arrays with zeros

M = max(cellfun(@length, myCell)); Wanted = cellfun(@(x) [x; zeros(M - numel(x), 1)], myCell, 'un', 0)

How to pad cell w/ multiple arrays with zeros

M = max(cellfun(@length, myCell)); Wanted = cellfun(@(x) [x; zeros(M - numel(x), 1)], myCell, 'un', 0)

8 jours ago | 0

| accepted