multidimensional array - Maximum value in a 3D matrix in MATLAB -
this question has answer here:
let if have 3d matrix a=randi([1, 9],[2 2 9])
, how find maximum value slices , return 1 maximum value? thanks!
use matlab's max function follows:
max(a(:))
example:
a=randi([1, 9],[2 2 2]) a(:,:,1) = 5 1 9 4 a(:,:,2) = 1 8 8 8 max(a(:)) ans = 9
Comments
Post a Comment