bjbdts
Electrical
- Sep 1, 2005
- 58
Hi,
I am trying to read a .txt data file. But somehow can only get "''". Below is my code of write file, and then read file.
%write data:
x=0:0.1:1;
y=[x;exp(x)];
fid=fopen ('C:\exptab.txt', 'w');
%fprintf(fid,'Exponential function\n');
fprintf(fid, '%6.2f %12.8f\n',y);
fclose (fid);
%read data
fid=fopen('C:\exptab.txt','r');
AA=fscanf(fid,'%6.3f %13.2f\n');
fclose(fid);
Can anybody please to help me find the error?
Thanks,
bj
I am trying to read a .txt data file. But somehow can only get "''". Below is my code of write file, and then read file.
%write data:
x=0:0.1:1;
y=[x;exp(x)];
fid=fopen ('C:\exptab.txt', 'w');
%fprintf(fid,'Exponential function\n');
fprintf(fid, '%6.2f %12.8f\n',y);
fclose (fid);
%read data
fid=fopen('C:\exptab.txt','r');
AA=fscanf(fid,'%6.3f %13.2f\n');
fclose(fid);
Can anybody please to help me find the error?
Thanks,
bj