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!

Modify cells meeting some criteria

Status
Not open for further replies.

mbudka

Computer
Joined
Feb 24, 2008
Messages
2
Location
GB
Is there a way to set all entries of the matrix which meet a given criteria to an arbitrary value?
I've got a distance matrix and want to set all cells with values greater than some threshold to NaN for graphing purposes. What I do now is a double loop but is there any function or trick which can do it for me?
 
Try the if function.

Two ways

1 - embedded with your normal formula:
=+if(NormalFormula<threshhold,NormalFormula,1E99)

2 - in a different sheet, referring to a cell in the original sheet that contains the formula:

i.e. in sheet 2 cell C3
=+IF(sheet1!C3<threshhold,sheet1!C3,1E99)

=====================================
Eng-tips forums: The best place on the web for engineering discussions.
 
Sorry, I didn't make myself clear - I'm talking about a matrxi in Matlab. But thanks anyway :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top