help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

fopen function


From: taquito
Subject: fopen function
Date: Fri, 20 Dec 2019 16:59:14 -0600 (CST)

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 = textscan(fid,formato,'HeaderLines',9);
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 = textscan(fid,formato,'HeaderLines',9);
fclose(fid);

then fid=-1 and the file hasn't opened. Do you know why happen this, and how
can I solve it? Thanks!







--
Sent from: https://octave.1599824.n4.nabble.com/Octave-General-f1599825.html



reply via email to

[Prev in Thread] Current Thread [Next in Thread]