MATLAB: How to find the maximum value of the 3-D plot in matlab

3-d plotmax value

How to find the maximum value of the 3-D plot in matlab? At present ,I am clicking with the help of Cursor after the generation of the 3-D plot . But is there any specific command for that? I have tried max(abs(figure)), but that generates an array and not a particular single value, I am in need to find the maximum single amplitude value of the plot. Kindly help

Best Answer

If your plot is for instance:
figure(1)
surf(X, Y, Z)
where all are matrices, convert ā€˜Zā€™ to a vector and then take the max:
Zmax = max(Z(:));
If you want to know where the maximum occurs, this will give you the indices:
[Zmax,Idx] = max(Z(:));
[ZmaxRow,ZmaxCol] = ind2sub(size(Z), Idx);