could anyone help me to solve the issue.

조회 수: 1 (최근 30일)
Prabha Kumaresan
Prabha Kumaresan 2018년 4월 17일
댓글: Veera Kanmani 2018년 4월 17일
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.

답변 (2개)

Veera Kanmani
Veera Kanmani 2018년 4월 17일
can you explain clearly, whether the outputs are cell or array. can you give me the piece of code
  댓글 수: 2
jaah navi
jaah navi 2018년 4월 17일
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 2018년 4월 17일
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)

댓글을 달려면 로그인하십시오.


Walter Roberson
Walter Roberson 2018년 4월 17일
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.

카테고리

Help CenterFile Exchange에서 Polynomials에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by