zephilly
Mechanical
- Oct 10, 2013
- 1
i want to write data into a txt file like
x = 0:.1:1;
A = [x; exp(x)];
fileID= fopen('exp.txt','w');
fprintf(fileID,'%6s %12s\n','x','exp(x)');
fprintf(fileID,'%6.2f %12.8f\n',A);
fclose(fileID);
But it always show that Error using fprintf Invalid file identifier. Use fopen to generate a valid file identifier.
Why i can't run this simple program!
Plz help.
x = 0:.1:1;
A = [x; exp(x)];
fileID= fopen('exp.txt','w');
fprintf(fileID,'%6s %12s\n','x','exp(x)');
fprintf(fileID,'%6.2f %12.8f\n',A);
fclose(fileID);
But it always show that Error using fprintf Invalid file identifier. Use fopen to generate a valid file identifier.
Why i can't run this simple program!
Plz help.