could anyone help me to solve the issue.

1 visualización (últimos 30 días)
Prabha Kumaresan
Prabha Kumaresan el 17 de Abr. de 2018
Comentada: Veera Kanmani el 17 de Abr. de 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.

Respuestas (2)

Veera Kanmani
Veera Kanmani el 17 de Abr. de 2018
can you explain clearly, whether the outputs are cell or array. can you give me the piece of code
  2 comentarios
jaah navi
jaah navi el 17 de Abr. de 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 el 17 de Abr. de 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)

Iniciar sesión para comentar.


Walter Roberson
Walter Roberson el 17 de Abr. de 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.

Categorías

Más información sobre COM Component Integration en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by