Communication through MATLAB is always better than arguing.

Answered

Month as a two digit number

ix = m < 10 % m is the output of the month(...) , by the way it can be set by Format in datetime(...) M = "" + m M(ix) =...

Month as a two digit number

ix = m < 10 % m is the output of the month(...) , by the way it can be set by Format in datetime(...) M = "" + m M(ix) =...

1 hour ago | 0

Answered

Split a string in this way

strsplit(STRING,'_') %or regexp(STRING, '\_', 'split')

Split a string in this way

strsplit(STRING,'_') %or regexp(STRING, '\_', 'split')

2 hours ago | 0

Answered

Unrecognized function or variable 'length' ???

length(Uu) = len1; % naming a variable length is a terrible idea!!! clear length

Unrecognized function or variable 'length' ???

length(Uu) = len1; % naming a variable length is a terrible idea!!! clear length

2 hours ago | 1

| accepted

Answered

livescript: move to next section

You could select that particular section and press ctrl/cmd + enter to run it.

livescript: move to next section

You could select that particular section and press ctrl/cmd + enter to run it.

2 hours ago | 0

Answered

select a subset of images according to the "image name list.txt" that matches a "1" in the "ground truth list.txt"

c = "image name 1.txt" c1 = "ground truth 1.txt" C = c(regexp(c, '\d*', 'match') == regexp(c1, '\d*', 'match'))

select a subset of images according to the "image name list.txt" that matches a "1" in the "ground truth list.txt"

c = "image name 1.txt" c1 = "ground truth 1.txt" C = c(regexp(c, '\d*', 'match') == regexp(c1, '\d*', 'match'))

4 hours ago | 0

Answered

MATLAB Answers Wish-list #5 (and bug reports)

Pressing ctrl/cmd + k brings up the hyper link dialog box , but why does it make the traget url empty and the display text with ...

MATLAB Answers Wish-list #5 (and bug reports)

Pressing ctrl/cmd + k brings up the hyper link dialog box , but why does it make the traget url empty and the display text with ...

4 hours ago | 0

Answered

Concatenate two cell colums with different length, in Variables window it is possible while horzcat gives "not consistent" error.

c = {a, b} %? if this doesn't do what you want , you need to illustrate with an expected result.

Concatenate two cell colums with different length, in Variables window it is possible while horzcat gives "not consistent" error.

c = {a, b} %? if this doesn't do what you want , you need to illustrate with an expected result.

4 hours ago | 0

Answered

Matrix with elements as polynomial

ROOTS = cell(numel(X), 1); for k = 1:numel(X) ROOTS{k} = roots(sym2poly(X(k))); end celldisp(ROOTS)

Matrix with elements as polynomial

ROOTS = cell(numel(X), 1); for k = 1:numel(X) ROOTS{k} = roots(sym2poly(X(k))); end celldisp(ROOTS)

5 hours ago | 2

| accepted

Answered

Reducing columns and rows numbers to match a certain matrix.

Find the minimum number of rows and columns and index every matrix until the minimum.

Reducing columns and rows numbers to match a certain matrix.

Find the minimum number of rows and columns and index every matrix until the minimum.

1 day ago | 1

Answered

how to sketch the domain of f(x y)= sqrt(y-x^2)/(1-x^2)

doc fimplicit

how to sketch the domain of f(x y)= sqrt(y-x^2)/(1-x^2)

doc fimplicit

1 day ago | 1

| accepted

Answered

Row position and find value

Replace Accelval with [rows, columns] = ... and use the rows to index the table of column 3

Row position and find value

Replace Accelval with [rows, columns] = ... and use the rows to index the table of column 3

2 days ago | 0

| accepted

Answered

How to make two column vectors from cell vector with space delimiter?

S = regexp(C, '\s', 'split'); s = cat(1, S{:}); datE = s(:,1) HouR = s(:,2)

How to make two column vectors from cell vector with space delimiter?

S = regexp(C, '\s', 'split'); s = cat(1, S{:}); datE = s(:,1) HouR = s(:,2)

2 days ago | 1

| accepted

Answered

Not able to get count of each elements in array itself

[~, ~, c] = unique(x); v = accumarray(c, 1); Wanted = v(c)

Not able to get count of each elements in array itself

[~, ~, c] = unique(x); v = accumarray(c, 1); Wanted = v(c)

2 days ago | 1

Answered

How to get the real&imaginary mode of the symbolic complex equation

syms A B real Function = A+1j*B rewrite(abs(Function),'sqrt')

How to get the real&imaginary mode of the symbolic complex equation

syms A B real Function = A+1j*B rewrite(abs(Function),'sqrt')

2 days ago | 0

| accepted

Answered

Create a vector for each element in another vector to constitute a matrix

[repelem(v, numel(v)), repmat(v, numel(v), 1)] %or [V1, V2] = meshgrid(v,v) [V1(:), V2(:)]

Create a vector for each element in another vector to constitute a matrix

[repelem(v, numel(v)), repmat(v, numel(v), 1)] %or [V1, V2] = meshgrid(v,v) [V1(:), V2(:)]

2 days ago | 0

Answered

How to solve the following equations with a given data. I need the correct coding to solve .

The below code is the way to solve them but the answer is no way near to get what you want , you have to experiment yourself to ...

How to solve the following equations with a given data. I need the correct coding to solve .

The below code is the way to solve them but the answer is no way near to get what you want , you have to experiment yourself to ...

2 days ago | 0

Answered

A is a matrix , what does this statement A([1,end],[1,end]) mean ?

That's equivalent to: [A(1,1), A(1,end);... A(1,end), A(end,end)] https://www.mathworks.com/company/newsletters/articles/m...

A is a matrix , what does this statement A([1,end],[1,end]) mean ?

That's equivalent to: [A(1,1), A(1,end);... A(1,end), A(end,end)] https://www.mathworks.com/company/newsletters/articles/m...

2 days ago | 1

| accepted

Answered

Subtracting values in an array between all the elements one by one

[X, Y] = meshgrid(x,y); XY = [X(:), Y(:)]; Wanted = -diff(XY)

Subtracting values in an array between all the elements one by one

[X, Y] = meshgrid(x,y); XY = [X(:), Y(:)]; Wanted = -diff(XY)

2 days ago | 1

Answered

Operations depending on the row/column

f2(1:169,:) = -f2(1:169,:)

Operations depending on the row/column

f2(1:169,:) = -f2(1:169,:)

2 days ago | 0

| accepted

Answered

How to plot a line over a specific interval?

ix = (g1 >= -1) & (g1 <= -.5); % follow the same for the rest plot(x(ix), g1(ix))

How to plot a line over a specific interval?

ix = (g1 >= -1) & (g1 <= -.5); % follow the same for the rest plot(x(ix), g1(ix))

3 days ago | 0

Answered

for loop with syms variable

% Newer versions syms th [1, 6] c = cos(th) %Older versions th = sym('th', [1, 6]); syms(th) c = cos(th)

for loop with syms variable

% Newer versions syms th [1, 6] c = cos(th) %Older versions th = sym('th', [1, 6]); syms(th) c = cos(th)

3 days ago | 0

| accepted

Answered

Incrementally increase power of a matrix

n = 10; m = arrayfun(@(x) A^x, 0:n, 'un', 0) M = cat(1, m{:})

Incrementally increase power of a matrix

n = 10; m = arrayfun(@(x) A^x, 0:n, 'un', 0) M = cat(1, m{:})

3 days ago | 0

Answered

Could anyone tell me what is wrong with the following code?

sprintf('%.32f',(6.6-5.5)/0.1) (6.6-5.5)/sym(0.1)

Could anyone tell me what is wrong with the following code?

sprintf('%.32f',(6.6-5.5)/0.1) (6.6-5.5)/sym(0.1)

3 days ago | 1

| accepted