I have a matrix in matlab with 10 different values. All values in my array are integer from 1 to 10. I need to save this matrix as an image (image.jpg). However I want to have the same values ( integers from 1 to 10) in my image when I read the image into the matlab. When I use imwrite or save or saveas I create an image but when I read it into matlab, values are from 0-255 no form 1-10.