MATLAB: Save an image in a directory

directoryprintsavesaveas

Hi, I used: print('-dtiff','example.tif') in my code. now, i need to save the image (example.tif) in a specified directory. My code is: baseFileName = sprintf('TEST%d.tif', j); fullFileName = fullfile(pathName, baseFileName); imwrite(example, fullFileName);
but this error occurs: ??? Undefined function or variable 'example' any idea?
tnx, Azi

Best Answer

Why not use print() directly.
print('-dtiff',fullFileName)