Question: promlem in fprintf


restart;

for x from 0.1 by 0.1 to 0.9 do
y[x]:=evalf(1+(e^x-sqrt(exp(1))/(exp(1)-1)));
od:

fd:=fopen("C:\\Users\\adel\\Desktop\\exactsolution\\exampleexact.dat", WRITE);
fprintf(fd,"#exactsolution\n");
for x from 0.1 by 0.1 to 0.9 do
fprintf(fd,"%7.4f    %6.7f\n ",x,y[x]);
end do:
fclose(fd);

 

 

 

Error, (in fprintf) number expected for floating point format

 


Download exactsolution.mw

Please Wait...