-1

Can someone explain to me how to save our converted image (from *.ppm into *.pgm) in specific directory in matlab..

Here is my code.

     pathName = 'D:\Matlab\Training\PGM_Files';
     % Create it if it doesn't exist.
     if ~exist(pathName, 'dir')
     mkdir(pathName);
     % This will create to the full depth of the path.
     % Upper folder levels don't have to exist yet.
     end
     fullFileName = fullfile(pathName);

     pgm_File_Images(loop1,1)=imwrite((Train_Images,['data',num2str(loop1),'.pgm']),
     fullFileName);    

I want to save all my file into folder PGM_Files. But everytime I got error

Expression or statement is incorrect--possibly unbalanced (, {, or [.

How to fix it??

1 Answers1

0

The answer was already given in the comments, I will thus post it here to make sure the question does not remain unanswered:

You don't provide the right kind of input arguments to imwrite. That's why the last ) claims to be unmatched.

Dennis Jaheruddin
  • 21,208
  • 8
  • 66
  • 122