Hello I am pretty new to Matlab, and I am trying to convert my data file into an 128×128 matrix in order to display an image. So, in my file I have 3 columns with 16384 numeric values in each of them, and I need to have 128x128x3 matrix, like a format of image. I was trying method reshape, but it did not work for me, I am getting an error such
Error using reshapeTo RESHAPE the number of elements must not change.
Here is my code
fileID = fopen('out.txt','r');formatSpec = '%d';A = fscanf(fileID,formatSpec);B = reshape (A,128,128);
Please suggest what would be the best solution for this problem.
Best Answer