Answered

How to remove trailing zeros while display any floting number ?

sprintf('%g',X)

How to remove trailing zeros while display any floting number ?

sprintf('%g',X)

6 years ago | 5

Answered

Element wise multiplication to matrix in a "matrix array"?

m1 = [1 2;3 4]; m2 = [2 7; 8 9]; m3 = [9 7; 8 91]; m = [m1 m2 m3] [n1,n2]=size(m1) v=[1 2 3] M=reshape(m,n1,n2,[]) B=bs...

Element wise multiplication to matrix in a "matrix array"?

m1 = [1 2;3 4]; m2 = [2 7; 8 9]; m3 = [9 7; 8 91]; m = [m1 m2 m3] [n1,n2]=size(m1) v=[1 2 3] M=reshape(m,n1,n2,[]) B=bs...

6 years ago | 0

Answered

A question on Scatter PLot ???

V1 = [1:10000;rand(1,10000)]; V2 = [1:10000;rand(1,10000)]; h = scatter(N, N , 'r*'); for lk = 1:10000 scatter(V1(1,lk...

A question on Scatter PLot ???

V1 = [1:10000;rand(1,10000)]; V2 = [1:10000;rand(1,10000)]; h = scatter(N, N , 'r*'); for lk = 1:10000 scatter(V1(1,lk...

6 years ago | 0

| accepted

Answered

How can I convert a 3D kxmxn matrix into n images directly?

for k=1:n Im=M (:,:, k) imwrite (Im,sprintf ('file% d', k)) end

How can I convert a 3D kxmxn matrix into n images directly?

for k=1:n Im=M (:,:, k) imwrite (Im,sprintf ('file% d', k)) end

6 years ago | 0

Answered

How do I find list down values in a matrix that is larger than 0.75?

Out=B (B>=0.75)

How do I find list down values in a matrix that is larger than 0.75?

Out=B (B>=0.75)

6 years ago | 0

| accepted

Answered

[SIMULINK] Increment a variable

<</matlabcentral/answers/uploaded_files/58384/ans1.jpg>>

[SIMULINK] Increment a variable

<</matlabcentral/answers/uploaded_files/58384/ans1.jpg>>

6 years ago | 0

| accepted

Answered

Alternative to 'ismember' for structures

You can compare ismember([B.a],[A.a]) ismember([B.b],[A.b])

Alternative to 'ismember' for structures

You can compare ismember([B.a],[A.a]) ismember([B.b],[A.b])

6 years ago | 0

Answered

Add zero rows to a matrix

A=[1 5; 2 4; 4 9; 6 3] A(logical(accumarray(A(:,1),1)),:)=A

Add zero rows to a matrix

A=[1 5; 2 4; 4 9; 6 3] A(logical(accumarray(A(:,1),1)),:)=A

6 years ago | 1

| accepted

Answered

Matrix linear indexing: how to add more than once to the same index

A = [1 2 ; 3 4] idx=[1 3 1] for k=1:numel(idx) A(idx(k))=A(idx(k))+1 end

Matrix linear indexing: how to add more than once to the same index

A = [1 2 ; 3 4] idx=[1 3 1] for k=1:numel(idx) A(idx(k))=A(idx(k))+1 end

6 years ago | 0

Answered

I have a matrix of size 10*4, I want to read the matrix and after that want to read only second column, so can I get output like that??

A=rand(10,4) c2=A(:,2)

I have a matrix of size 10*4, I want to read the matrix and after that want to read only second column, so can I get output like that??

A=rand(10,4) c2=A(:,2)

6 years ago | 0

| accepted

Answered

Activating help for sub function

mymean is not saved as a file, If you want to see the documentation inside mymean, you have to save it in a file mymean.m, or pu...

Activating help for sub function

mymean is not saved as a file, If you want to see the documentation inside mymean, you have to save it in a file mymean.m, or pu...

6 years ago | 0

| accepted

Answered

Using the struct function with a for loop

This is a very bad programming practice, please read this: <http://matlab.wikia.com/wiki/FAQ#How_can_I_create_variables_A1.2C_A2...

Using the struct function with a for loop

This is a very bad programming practice, please read this: <http://matlab.wikia.com/wiki/FAQ#How_can_I_create_variables_A1.2C_A2...

6 years ago | 0

Answered

Importing Data from excel across multiple sheets and filenames.

[~,sheet_name]=xlsfinfo('filename.xlsx') for k=1:numel(shhet_name) data{k}=xlsread('filename.xlsx',sheet_name{k}) end ...

Importing Data from excel across multiple sheets and filenames.

[~,sheet_name]=xlsfinfo('filename.xlsx') for k=1:numel(shhet_name) data{k}=xlsread('filename.xlsx',sheet_name{k}) end ...

6 years ago | 10

| accepted

Answered

Assign to certain positions of an entire cell array values from another cell array of the same size

a_part{1} = [1; 2; 8]; a_part{2}=[11; 31; 15]; a_part{3} =[2; 4; 8] a_whole = cell(1,3) out=cellfun(@(x) [x(1) 0 x(2) 0 x...

Assign to certain positions of an entire cell array values from another cell array of the same size

a_part{1} = [1; 2; 8]; a_part{2}=[11; 31; 15]; a_part{3} =[2; 4; 8] a_whole = cell(1,3) out=cellfun(@(x) [x(1) 0 x(2) 0 x...

6 years ago | 0

Answered

DO WE CONSIDER ZERO,S IN AVERAGE FILLING METHOD FOR PREDICTION

A=[2 3 0 0 4] sum(A)/nnz(A)

DO WE CONSIDER ZERO,S IN AVERAGE FILLING METHOD FOR PREDICTION

A=[2 3 0 0 4] sum(A)/nnz(A)

6 years ago | 0

Answered

How can I call the variable from one MATLAB file into another?

In siddesh.m file Run the file ram.m, just type ram

How can I call the variable from one MATLAB file into another?

In siddesh.m file Run the file ram.m, just type ram

6 years ago | 0

Answered

Write Strings into a matrix

Use cell arrays A{1}=100 A{2}='text' or A={100 'text'} There is another alternative, a struct variable A...

Write Strings into a matrix

Use cell arrays A{1}=100 A{2}='text' or A={100 'text'} There is another alternative, a struct variable A...

6 years ago | 0

| accepted

Answered

Check the existence of a directory based on part of a string?

When you run f=dir(current_folder) You wil get a cell array of the content of your current folder, like f={'CL_C...

Check the existence of a directory based on part of a string?

When you run f=dir(current_folder) You wil get a cell array of the content of your current folder, like f={'CL_C...

6 years ago | 1

Answered

Reading image files from different folders ?

f=struct('name',{'D:\A1' 'D:\A3' 'D:\A3'}) % Example for k=1:numel(f) path=f(k).name p=dir(path) %do end

Reading image files from different folders ?

f=struct('name',{'D:\A1' 'D:\A3' 'D:\A3'}) % Example for k=1:numel(f) path=f(k).name p=dir(path) %do end

6 years ago | 0

Answered

How do i use LQR control in state space form?

You have first to tell us what are the inputs and outputs of your system. Post the parameters representing your system, and post...

How do i use LQR control in state space form?

You have first to tell us what are the inputs and outputs of your system. Post the parameters representing your system, and post...

6 years ago | 0

Answered

Insert underscore into the string

a = datestr(now,31) a=datestr(a,'yymmdd_HHMMSS')

Insert underscore into the string

a = datestr(now,31) a=datestr(a,'yymmdd_HHMMSS')

6 years ago | 0

Answered

how to find maximum value in some specific group range of matrix

A=[3 2 5 6; 4 2 5 5; 5 2 5 3; 6 2 5 4; 7 2 5 1; 8 2 5 1; 9 2 5 3; 11 2 5 1; 2 3 8 6; 4 3 8 3; 5 3 8 3] [ii,jj,kk]=unique(A(:,...

how to find maximum value in some specific group range of matrix

A=[3 2 5 6; 4 2 5 5; 5 2 5 3; 6 2 5 4; 7 2 5 1; 8 2 5 1; 9 2 5 3; 11 2 5 1; 2 3 8 6; 4 3 8 3; 5 3 8 3] [ii,jj,kk]=unique(A(:,...

6 years ago | 0

Answered

Undefined function or variable 'getImageLabels'.

It's not a built-in Matlab function, you need to download it here <https://www.mathworks.com/matlabcentral/fileexchange/50232-ma...

Undefined function or variable 'getImageLabels'.

It's not a built-in Matlab function, you need to download it here <https://www.mathworks.com/matlabcentral/fileexchange/50232-ma...

6 years ago | 1

| accepted

Answered

how can we calculate count of specific group in a row

A=[3 2 5, 3 2 5, 4 2 5, 4 2 5, 4 2 5] [ii,jj,kk]=unique(A,'rows','stable') out=[ii,accumarray(kk,1)]

how can we calculate count of specific group in a row

A=[3 2 5, 3 2 5, 4 2 5, 4 2 5, 4 2 5] [ii,jj,kk]=unique(A,'rows','stable') out=[ii,accumarray(kk,1)]

6 years ago | 0

| accepted

Answered

hello every one, i have two type of data one set of manual and second set are automatic , can any one help me to to find the correlation coefficient for each manual and automatic values.

<http://www.mathworks.com/help/matlab/ref/corrcoef.html#buty8hi>

hello every one, i have two type of data one set of manual and second set are automatic , can any one help me to to find the correlation coefficient for each manual and automatic values.

<http://www.mathworks.com/help/matlab/ref/corrcoef.html#buty8hi>

6 years ago | 0

| accepted