title: Saving grayscale image as it appears in jet colormap
body: <p>I have grayscale satellite image which is processed from spectral data (band classifications). If i use jet colormap in imshow it will show absolute colormapped image. But if i try to imwrite in particular place it is saved like a bluish image. I saw one example in matlab central, but i didnt get. can anyone help me to write my image with colorscaled image.</p>
  
  <p>Matlab central link: <a href="http://www.mathworks.in/matlabcentral/answers/25026-saving-grayscale-image-as-it-appears-in-jet-colormap-of-imagesc" rel="nofollow">http://www.mathworks.in/matlabcentral/answers/25026-saving-grayscale-image-as-it-appears-in-jet-colormap-of-imagesc</a></p>
  
  <p>there accepted answer link is : <a href="http://www.mathworks.com/matlabcentral/fileexchange/7943" rel="nofollow">http://www.mathworks.com/matlabcentral/fileexchange/7943</a></p>
  
  <p>I have tried many times, this will show colormaped images in plots (imshow) they didnt write anywhere with colormaped. Now i want to write my image with colormaped.</p>
  
  <p>example code:</p>
  
  <pre><code>I= imread('image path');
  imshow(I,'colormap',jet);
  imwrite(I,'path','jpg');  /not working
  </code></pre>
  
  <p>or</p>
  
  <pre><code>imwrite(I,jet,'path','jpg');  /not working
  </code></pre>
  
  <p>Please help to solve this issue.</p>