MATLAB Answers

matrix turning nans to 1

1 view (last 30 days)
Mate 2u
Mate 2u on 18 Jul 2012
Hi all, I have a 294x1 matrix, and I want to convert all the NaNs to 1.
If anybody could assist me I would be grateful.
Thanky ou.

  0 Comments

Sign in to comment.

Accepted Answer

Matt Kindig
Matt Kindig on 18 Jul 2012
Let M be your matrix.
M(isnan(M))=1;

  0 Comments

Sign in to comment.

More Answers (0)

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!