Error using fopen

4 次查看(过去 30 天)
med-sweng
med-sweng 2014-8-25
Hi,
I'm using the following command in a for-loop:
imwrite(x,strcat('L_',num2str(c),'_m.bmp'),'bmp');
And, getting the following error:
Error using fopen
File name must be a vector of type char.
Error in imwrite (line 453)
fid = fopen(filename, 'a');
Error in fuzzycmeans (line 83)
imwrite(x,strcat('L_',num2str(c),'_m.bmp'),'bmp');
Why is that? How can I fix this issue?
Thanks.

回答(1 个)

Star Strider
Star Strider 2014-8-25
As a troubleshooting step, run this line:
flnm = strcat('L_',num2str(c),'_m.bmp')
just before your imwrite call and see what the result is.
  2 个评论
med-sweng
med-sweng 2014-8-27
Thanks for your reply. Sorry, still the same issue.
Star Strider
Star Strider 2014-8-27
What does ‘flnm’ produce? Is it ‘a vector of type char’?
If you do:
cn = class(flnm)
what is the result?

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Low-Level File I/O 的更多信息

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by