multi-dimensional array, minimum, coordinate

Hello, I have to find minimum element of multi-dimensional array and its coordinate
I have this, error=criteria(k,code,i);
thanks

 Accepted Answer

a=rand(3,4,5);
[min_v,idx]=min(a(:))
[ii,jj,kk]=ind2sub(size(a),idx)

More Answers (0)

Categories

Community Treasure Hunt

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

Start Hunting!