MATLAB: Can anyone help me to get the maximum value among all the values for the following result.

maximum value

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
iwant1=max(iwant(:,:,:))
I am getting the result such that it considers only the last value. But for the above result i want to have the value as 1.9546e+08. Can anyone help me to get that value.

Best Answer

max(iwant(:))