Hi! I'm trying to open a text file with fopen. The name of the file is '352'.
If I do this
fid=fopen('352', 'rt');
formato=('%s %s %s %s %s %s %s %s');
data = "">
fclose(fid);
fid>1 then everything is Ok. But if I define the variables a=1, b=351, and
c=a+b, then:
a=1;
b=351;
c=a+b;
fid=fopen('c', 'rt');
formato=('%s %s %s %s %s %s %s %s');
data = "">
fclose(fid);
then fid=-1 and the file hasn't opened. Do you know why happen this, and how
can I solve it? Thanks!
the first 352 is a string and the second 352 is a number.
Try using the mat2str function
a=1;
b=351;
c=a+b;
sc=mat2str(c)
fid=fopen(sc, 'rt');
formato=('%s %s %s %s %s %s %s %s');
data = "">
fclose(fid);
I did not try this but I think it should work
--
DAS
![Certificate for 206392 Certificate for 206392]()