I am trying to display multiple images in one figure using the following code:
[imgs labels] = readMNIST('t10k-images-idx3-ubyte', 't10k-labels-idx1-ubyte', 50, 10);for i=2:50im=imgs(:,:,i);im=255.*im;name = ['image',num2str(i),'.jpeg'];imwrite (im,['image',num2str(i),'.jpeg']);endimshow(im);
But the code gives this error:
Error using fopenFirst input must be a file name of type char, or a file identifier of type double.Error in imshow (line 25) fid = fopen(imgFile, 'r', 'b');Error in test (line 24)imshow(BW2,'notruesize')
if I remove the imshow (im); command, the code works fine and save the image files without any problem. I am using Matlab 2014b. Thanks in advance.
Best Answer