Matlab imshow omit NaN
<p>I am using <code>imshow()</code> to visualize data obtained from the difference of two grayscale images. The images are masked, i.e. each pixel 'laying under' the mask has the value <code>NaN</code>. The data are represented by the <code>parula</code> colormap. The problem is that <code>imshow()</code> treates <code>NaN</code> as zero and therefore the masked pixels are represented as blue. Is there an easy way to omit the masked pixels or to display them in a color that is not part of the colormap (e.g. white, gray, or black)?</p>

<p>I would prefer the solution to base on <code>imshow()</code> since it would be easiest to include into my code. However, solutions using <code>pcolor</code>, <code>imagesc</code> or the like will also be appreciated. </p>