【发布时间】:2014-05-21 06:57:20
【问题描述】:
有人可以向我解释如何将转换后的图像(从 *.ppm 到 *.pgm)保存在 matlab 的特定目录中..
这是我的代码。
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);
我想将我的所有文件保存到文件夹 PGM_Files 中。 但是每次我出错
Expression or statement is incorrect--possibly unbalanced (, {, or [.
如何解决??
【问题讨论】:
-
您是否阅读了错误信息?某处你的括号不匹配。
-
当我运行该代码时,我收到错误消息 mssg“表达式或语句不正确——可能是不平衡的 (、{ 或 [。”但是我的括号已经是正确的.. 我不知道出了什么问题使用该代码
-
作为提示:寻找一个没有
[的]。 -
我已经尝试过了,但还是一样
-
您没有提供right kind of input arguments to
imwrite。这就是为什么最后一个)声称无与伦比。
标签: image matlab file-conversion