matrix turning nans to 1

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.

 Akzeptierte Antwort

Matt Kindig
Matt Kindig am 18 Jul. 2012

2 Stimmen

Let M be your matrix.
M(isnan(M))=1;

Weitere Antworten (0)

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by