Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations cowski on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

extract value in first row of nested arrays in a matrix

Status
Not open for further replies.

pepdave

Agricultural
Joined
Apr 22, 2009
Messages
3
Location
AU
I iterated the max() function for each column in a mxn matrix M. This generated an array of maximum values in each of n columns.

I then used the match(z,M) function with z as the maximum values to return position of value z in each column of matrix M. This worked! and generated another array of nested arrays. I now want to extract the first value from each of the nested arrays within the 'parent' array. How do I do this?

Thanks in advance for any help.
 
To get a value from a non-nested array you would type (for example)

A := B[r,c

where r and c are row and column of array B. For a nested array, it is similar but with one or more additional r and c. The key also is selecting the entire expression before pressing "[".

A := B[r1,c1 <space> <space> [r2,c2

Pressing space twice puts the blue line under the entire right hand side expression.

Peter
 
Peter, thankyou, thankyou, thankyou!
My early thoughts were that mathcad was limited but it is me who has limits. I am very grateful for this tip. Cheers, Dave
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top