could anyone help me to solve the issue.

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.

Answers (2)

can you explain clearly, whether the outputs are cell or array. can you give me the piece of code

2 Comments

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.
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)

Sign in to comment.

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.

Categories

Tags

Asked:

on 17 Apr 2018

Commented:

on 17 Apr 2018

Community Treasure Hunt

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

Start Hunting!