I am trying to find a 2d array that represents the minimum values of the 3rd dimension in a 3d array. For example,
a = floor(rand(10,10,3).*100); % representative structure b = min(a,[],3); % this finds the minimum but also includes 0
I tried using:
min(a(a>0),3)
but is it wrong? I guess I could sort the third dimension of a, and then find the minimum within 1: depth-1 - but this does not seem to be the most efficient way?
Any thoughts?
multidimensional-array matlab
trican
source share