title: Matlab, rgb2gray gives colour image as output
body: <p>Could you please clarify, how does function "rgb2gray" in Matlab work?</p>
  
  <pre><code>u=imread('C:\im1.jpg');
  image(rgb2gray(u));
  </code></pre>
  
  <p>Info on original image:</p>
  
  <p>ans = </p>
  
  <pre><code>       Filename: 'C:\im1.jpg'
      FileModDate: '09-Mar-2014 20:30:14'
         FileSize: 8653
           Format: 'jpg'
    FormatVersion: ''
            Width: 320
           Height: 240
         BitDepth: 24
        ColorType: 'truecolor'
  FormatSignature: ''
  NumberOfSamples: 3
     CodingMethod: 'Huffman'
    CodingProcess: 'Sequential'
          Comment: {}
  </code></pre>
  
  <p>I receive output image, but it is definitely not grayscale.. Just some image with very bright colouts. I couldn't find any clues in documentation - perhaps problems is related to color depth of original picture.</p>
  
  <p>Thanks!</p>