Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>The only way I am able to reproduce the error that you get is when <code>map</code> is a two-element vector where the first element is greater than the second. Note first that the function <a href="http://www.mathworks.com/access/helpdesk/help/toolbox/images/imshow.html" rel="nofollow noreferrer">IMSHOW</a> can be called with the following syntax:</p> <pre><code>imshow(I,[low high]); </code></pre> <p>In which <code>I</code> is a grayscale image and <code>low</code> and <code>high</code> specify the display range for the pixel intensities. The extra argument is ignored when <code>I</code> is an RGB image, but even then the value of <code>high</code> must be greater than the value of <code>low</code> or an error is thrown (the one you see above).</p> <p>What's confusing is why <code>map</code> would be a two-element vector. When loading an image with <a href="http://www.mathworks.com/access/helpdesk/help/techdoc/ref/imread.html" rel="nofollow noreferrer">IMREAD</a>, the <code>map</code> output will either be empty (if the image is not an indexed image) or it will be an N-by-3 color map. I can't think of a situation where the built-in <a href="http://www.mathworks.com/access/helpdesk/help/techdoc/ref/imread.html" rel="nofollow noreferrer">IMREAD</a> would return a <code>map</code> argument with just 2 elements.</p> <p>Based on the fact that you said it <em>was</em> working, and now suddenly isn't, I would suggest first checking to see if you have inadvertently created an m-file somewhere with the name <code>imread</code>. Doing so could cause that new <code>imread</code> function to be called instead of the built-in one, giving you different outputs than you expect.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload