could anyone help me to solve the issue.

2 Ansichten (letzte 30 Tage)
Prabha Kumaresan
Prabha Kumaresan am 17 Apr. 2018
Kommentiert: Veera Kanmani am 17 Apr. 2018
output1 =
1.0e+08 *
0
0
0
0
2.2404
output1 =
1.0e+07 *
0
0
0
0
5.3112
output1 =
1.0e+07 *
0
0
0
0
6.7387
output1 =
1.0e+07 *
0
0
0
0
4.7917
output1 =
1.0e+08 *
0
0
0
0
2.2508
For the above result i want to find the maximum of output1. I tried with the command iwant=max(cell2mat(output1(:))) but i am getting error stating Cell contents reference from a non-cell array object.Could anyone help me to solve the issue.

Antworten (2)

Veera Kanmani
Veera Kanmani am 17 Apr. 2018
can you explain clearly, whether the outputs are cell or array. can you give me the piece of code
  2 Kommentare
jaah navi
jaah navi am 17 Apr. 2018
code:
iwant = 1.1093e+08
iwant(:,:,1) = 0
iwant(:,:,2) = 1.4517e+08
iwant(:,:,1) = 0
iwant(:,:,2) = 0
iwant(:,:,3) = 1.3899e+08
iwant(:,:,1) = 0
iwant(:,:,2) = 0
iwant(:,:,3) = 0
iwant(:,:,4) = 1.9546e+08
iwant(:,:,1) = 0
iwant(:,:,2) = 0
iwant(:,:,3) = 0
iwant(:,:,4) = 0
iwant(:,:,5) = 1.2051e+08
iwant(:,:,1) = 0
iwant(:,:,2) = 0
iwant(:,:,3) = 0
iwant(:,:,4) = 0
iwant(:,:,5) = 0
iwant(:,:,6) = 1.3012e+08
iwant1=max(iwant(:,:,:))
I want to have the value as 1.9546e+08.but it is considering only the last one.
Veera Kanmani
Veera Kanmani am 17 Apr. 2018
since you are overwriting the values, the output is not coming,, try the following
iwant1 = 1.1093e+08;
iwant2(:,:,1) = 0;
iwant2(:,:,2) = 1.4517e+08;
iwant3(:,:,1) = 0;
iwant3(:,:,2) = 0;
iwant3(:,:,3) = 1.3899e+08;
iwant4(:,:,1) = 0;
iwant4(:,:,2) = 0;
iwant4(:,:,3) = 0;
iwant4(:,:,4) = 1.9546e+08;
iwant5(:,:,1) = 0;
iwant5(:,:,2) = 0;
iwant5(:,:,3) = 0;
iwant5(:,:,4) = 0;
iwant5(:,:,5) = 1.2051e+08;
iwant6(:,:,1) = 0;
iwant6(:,:,2) = 0;
iwant6(:,:,3) = 0;
iwant6(:,:,4) = 0;
iwant6(:,:,5) = 0;
iwant6(:,:,6) = 1.3012e+08;
output1=[iwant1(:);iwant2(:);iwant3(:);iwant4(:);iwant5(:);iwant6(:)];
Max_output1=max(output1)

Melden Sie sich an, um zu kommentieren.


Walter Roberson
Walter Roberson am 17 Apr. 2018
You are not storing all of those values in output1. Your output1 is just a regular numeric array. It is possible that you are storing them somewhere else in a cell array.

Kategorien

Mehr zu COM Component Integration finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by