How to replace all non-NAN values with unity? : <p>I have a 3500*7500 matrix where I have NAN and other values. I want to basically convert all non-NAN values with 1.</p>

<p>I can use ~isnan(mat) to convert NAN to 0 and non-NAN to 1. </p>

<p>Is there a similar function to convert non-NAN values with 1 and leaving NANs as they are.</p>
