help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

minimum value of a matrix


From: John W. Eaton
Subject: minimum value of a matrix
Date: Mon, 01 Dec 2008 10:41:48 -0500

On  1-Dec-2008, Luca Penasa wrote:

| How can i find the minimum value of a matrix? i mean find the row and
| column index of the cell that contains the minimum value...
| I see that min() give the minimum of every column...

Something like

  x = rand (2, 3, 4);
  [val, ind] = min (x(:));
  subs = cell (ndims (x), 1);
  [subs{:}] = ind2sub (size (x), ind);

should do it.

jwe


reply via email to

[Prev in Thread] Current Thread [Next in Thread]