Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

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

Delete NaN Values

Status
Not open for further replies.

Anerol

Civil/Environmental
Dec 18, 2003
8
My matrix contains NaN values. How do I create a new array from my matrix without including the NaN values?

Help!
Thank you thank you =)
 
Replies continue below

Recommended for you

If you want to replace NaNs with zeros in the matrix A you can use the "find" command: Something like...

A(find(A==Nan)) = 0;

M



--
Dr Michael F Platten
 
You can also do this if you want to delete the NaN's

A(A=NaN)=[];

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor