mn = cellfun(@(x) min(x(x>0)),A,'Un',0);[mn,idx] = min(fliplr([mn{:}])); mn % Show the minimum positve value.
idx = length(A) - idx + 1 % Which cell has the min.
L = cellfun(@(x) find(x==mn),A,'Un',0);L = L{idx} % And the positions.
I am trying to find the coordinates with the above formula in a cell array 100×61 but each time I get a value that is negative. idx for instance turns negative and this does not help me to locate the coordinates of the minimum value in that cell array. Can anyone help please
Best Answer