Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

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

Newb Question Printing Matrix Values

Status
Not open for further replies.

ksbdh05

Civil/Environmental
Apr 4, 2007
1
Hey I'm stumped here. How can I print the location of values in a matrix. For Example if I have a 10x10 matrix with random numbers how can I find and print out the location of every number greater than ten. Thanks
 
Replies continue below

Recommended for you

You can use "find" and a logical expression. For example,

[row,col] = find(X > 10)

returns indices corresponding to the entries of X that are greater than 10.

xnuke
"Live and act within the limit of your knowledge and keep expanding it to the limit of your life." Ayn Rand, Atlas Shrugged.
Please see FAQ731-376 for tips on how to make the best use of Eng-Tips.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor