Find element in Vector
Find element in Vector
(OP)
In MatchCad 14 I have an array with one column and 2000 rows. If I do x=min(Array) I get the minimum value. I want to know the row number of that minimum value. Is there a reasonable way to extract it?
David Simpson, PE
MuleShoe Engineering
"Belief" is the acceptance of an hypotheses in the absence of data.
"Prejudice" is having an opinion not supported by the preponderance of the data.
"Knowledge" is only found through the accumulation and analysis of data.





RE: Find element in Vector
k:0;rows(Array)-1 indices corresponding to the rows of Array
row[k:k -- creates a vector of row numbers corresponding to the rows of Array
lookup(x,Array,row)[0 -- looks up x in Array, and returns the value in row with the same column and row; the [0 is because lookup returns an array with a single element
TTFN
FAQ731-376: Eng-Tips.com Forum Policies
RE: Find element in Vector
This will (should!) return the index of the minimum value of x
RE: Find element in Vector
Thanks for the help so far.
David Simpson, PE
MuleShoe Engineering
"Belief" is the acceptance of an hypotheses in the absence of data.
"Prejudice" is having an opinion not supported by the preponderance of the data.
"Knowledge" is only found through the accumulation and analysis of data.