Mombu the Science Forum sponsored links

Go Back   Mombu the Science Forum > Science > matlab functions. how can i find minimum of an array?
User Name
Password
REGISTER NOW! Mark Forums Read

sponsored links


Reply
 
1 16th November 13:05
tom
External User
 
Posts: 1
Default matlab functions. how can i find minimum of an array?



ok, so i have two one dimensional arrays. x and y. they are of equal size(evaluated a function, each x corresponds with a y-value).

i want to find the smallest value of y and the corresponding x value. i know i can use min(y) to find the smallest value in y, but how can i get the corresponding value in x?
  Reply With Quote


  sponsored links


2 16th November 13:06
matthew crema
External User
 
Posts: 1
Default matlab functions. how can i find minimum of an array?



help find

-Matt
  Reply With Quote
3 16th November 13:06
ror7
External User
 
Posts: 1
Default matlab functions. how can i find minimum of an array?


X(find(Y==min(Y)))
  Reply With Quote
4 16th November 13:06
mark b stucky
External User
 
Posts: 1
Default matlab functions. how can i find minimum of an array?


Try,

[ymin, iymin] = min(y);

and then your x value is

x(iymin)

[C,I] = min(...) finds the indices of the minimum values of A, and returns
them in
output vector I. If there are several identical minimum values, the index of
the first one
found is returned.

--Mark
  Reply With Quote
Reply


Thread Tools
Display Modes




Copyright © 2006 SmartyDevil.com - Dies Mies Jeschet Boenedoesef Douvema Enitemaus -
666