Answered

Position of the left nearest one value in a vector

I don't know what you mean by shamely blocked. It's not a trivial one though. x=v; Start=strfind([0,v==1],[0,1]); End=strfin...

Position of the left nearest one value in a vector

I don't know what you mean by shamely blocked. It's not a trivial one though. x=v; Start=strfind([0,v==1],[0,1]); End=strfin...

5 dagen ago | 1

| accepted

Answered

Created random sequence based on predefined vector

v = repelem(SP,Y); W = v(randperm(numel(v))) % numel(W)

Created random sequence based on predefined vector

v = repelem(SP,Y); W = v(randperm(numel(v))) % numel(W)

5 dagen ago | 2

| accepted

Answered

Could anyone help me to solve the issue.

NN = num2cell(num2cell(position),2)

Could anyone help me to solve the issue.

NN = num2cell(num2cell(position),2)

6 dagen ago | 0

| accepted

Answered

could anyone help me to arrange the number in set brackets {}

num2cell(a,2)

could anyone help me to arrange the number in set brackets {}

num2cell(a,2)

6 dagen ago | 0

Question

Why doesn’t livescript display the results in LATEX form?

When I was using 2017a the results of symbolic operations resulted in LATEX form but why does it not happening in 2018b? Is ther...

6 dagen ago | 0 answers | 0

Answered

How to make a variable an even number?

Is your question "How to check if a variable consists of even numbers?" Google "even number mod matlab"

How to make a variable an even number?

Is your question "How to check if a variable consists of even numbers?" Google "even number mod matlab"

6 dagen ago | 0

| accepted

Answered

How can i link same index of two vectors vectors?

[~,index]=max(V); Value = M(index)

How can i link same index of two vectors vectors?

[~,index]=max(V); Value = M(index)

7 dagen ago | 1

| accepted

Answered

storing data in a matrix from a nested loop

[m,n]=size(d1); [m1,n1]=size(d2); z = permute(reshape(d1.',1,n,m) - d2,[2,1,3]) d12 = reshape(z,n,[]).' % Or if you prefer...

storing data in a matrix from a nested loop

[m,n]=size(d1); [m1,n1]=size(d2); z = permute(reshape(d1.',1,n,m) - d2,[2,1,3]) d12 = reshape(z,n,[]).' % Or if you prefer...

7 dagen ago | 0

Answered

I don't know if matlab is calculating this properly

Result = mysum(2,10) % just call it like this doc function % to know how to use functions function SUM = mysum(...

I don't know if matlab is calculating this properly

Result = mysum(2,10) % just call it like this doc function % to know how to use functions function SUM = mysum(...

7 dagen ago | 1

Answered

How to compute logs in MATLAB

help log edit: you already had the answer in your question before editing your question which was after this answer being g...

How to compute logs in MATLAB

help log edit: you already had the answer in your question before editing your question which was after this answer being g...

7 dagen ago | 0

Answered

Count the number of same elements in an array

[~,~,ix] = unique(V); C = accumarray(ix,1).'

Count the number of same elements in an array

[~,~,ix] = unique(V); C = accumarray(ix,1).'

7 dagen ago | 2

| accepted

Answered

Index in position 1 is invalid. Array indices must be positive integers or logical values. Z=null(R,'r')

This is the exact reason why people shouldn’t name variables as the names of inbuilt functions!! clear null % to clear...

Index in position 1 is invalid. Array indices must be positive integers or logical values. Z=null(R,'r')

This is the exact reason why people shouldn’t name variables as the names of inbuilt functions!! clear null % to clear...

7 dagen ago | 1

| accepted

Answered

how to plot this function?

x=@(t)cos(t)+cos(2*t) y=@(t)sin(2*t) % you can use fplot() help fplot doc fplot

how to plot this function?

x=@(t)cos(t)+cos(2*t) y=@(t)sin(2*t) % you can use fplot() help fplot doc fplot

7 dagen ago | 0

| accepted

Answered

How to extract individual vectors out of a matrix and save them with different names?

What you're doing is not a good idea see https://in.mathworks.com/matlabcentral/answers/304528-tutorial-why-variables-should-not...

How to extract individual vectors out of a matrix and save them with different names?

What you're doing is not a good idea see https://in.mathworks.com/matlabcentral/answers/304528-tutorial-why-variables-should-not...

8 dagen ago | 0

| accepted

Answered

Filling gaps in time series with Nan

d = (data(1,1):data(end,1)).'; ix = ismember(d,data(:,1)); new_data = [d,nan(numel(d),1)]; new_data(ix,2) = data(:,2)

Filling gaps in time series with Nan

d = (data(1,1):data(end,1)).'; ix = ismember(d,data(:,1)); new_data = [d,nan(numel(d),1)]; new_data(ix,2) = data(:,2)

8 dagen ago | 0

| accepted

Answered

How to load data files from different folder using for loop?

Use \\ instead of \

How to load data files from different folder using for loop?

Use \\ instead of \

8 dagen ago | 1

| accepted

Answered

apply condition on Matrix?

Just use logical indexing "==" to see the values equal 1 and use nnz() and then use >= T if you get 1 it's true else false. hel...

apply condition on Matrix?

Just use logical indexing "==" to see the values equal 1 and use nnz() and then use >= T if you get 1 it's true else false. hel...

8 dagen ago | 1

| accepted

Answered

Removing char in a mixed string column so only numerical values are left?

Wanted = str2double(regexprep(LED,'LED','')) % ^^^--- is your columns of data containing mixed data

Removing char in a mixed string column so only numerical values are left?

Wanted = str2double(regexprep(LED,'LED','')) % ^^^--- is your columns of data containing mixed data

8 dagen ago | 1

Answered

How to plot a graph from matrix each row elements should start plotting from row number

I'm not certain what you want though , see if the below satisfies your needs: plot(matrix)

How to plot a graph from matrix each row elements should start plotting from row number

I'm not certain what you want though , see if the below satisfies your needs: plot(matrix)

8 dagen ago | 0

Answered

Can somebody explain me this answer?

The code copies the third element of a as 2 by 2 matrix, see the below example: >> a a = 1 2 3 4 >>...

Can somebody explain me this answer?

The code copies the third element of a as 2 by 2 matrix, see the below example: >> a a = 1 2 3 4 >>...

8 dagen ago | 1

| accepted

Answered

Why does setdiff answer depend on order of arguments?

bob not in bill (nothing unique all elements of bob belong to bill) help setdiff

Why does setdiff answer depend on order of arguments?

bob not in bill (nothing unique all elements of bob belong to bill) help setdiff

8 dagen ago | 0

Answered

How do i plot this in matlab

y = -(sin(pi/2*cos(x))Operator missing here(-pi/2*sin(x))./cos(x)

How do i plot this in matlab

y = -(sin(pi/2*cos(x))Operator missing here(-pi/2*sin(x))./cos(x)

8 dagen ago | 0

| accepted

Answered

remove row in A by referencing on another matrix, B, with true or false to produce another matrix c

Use the same approach shown in your previous questions! C = A(B==false,:)

remove row in A by referencing on another matrix, B, with true or false to produce another matrix c

Use the same approach shown in your previous questions! C = A(B==false,:)

8 dagen ago | 1

| accepted

Answered

remove specific rows by referencing on the first digit of each row.

B = A(~A(:,1),:)

remove specific rows by referencing on the first digit of each row.

B = A(~A(:,1),:)

8 dagen ago | 0

| accepted

Answered

Answer is not displayed on static text

https://in.mathworks.com/matlabcentral/answers/479420-answer-is-not-displayed-on-static-text#comment_743486

Answer is not displayed on static text

https://in.mathworks.com/matlabcentral/answers/479420-answer-is-not-displayed-on-static-text#comment_743486

9 dagen ago | 0

| accepted

Answered

How to find the full file path with only a folder?

s = what(Folder); s.path

How to find the full file path with only a folder?

s = what(Folder); s.path

9 dagen ago | 2

Answered

How to find single index values in a matrix?

https://in.mathworks.com/company/newsletters/articles/matrix-indexing-in-matlab.html - read it for better understanding Linear...

How to find single index values in a matrix?

https://in.mathworks.com/company/newsletters/articles/matrix-indexing-in-matlab.html - read it for better understanding Linear...

9 dagen ago | 1

| accepted