Re: File writing Problem



I think you should start by reading this :

<http://www.mathworks.com/access/helpdesk/help/techdoc/matlab_prog/ch_imp50.html>

Try this (I know that it's a simple example) :

a=[1 2 2 5 4];
b=[3 3 4 1 1];

n=length(a);

fid=fopen('results.txt','wt');
fprintf(fid,[repmat('%d ',1,n) '\n'],a+b);
fprintf(fid,[repmat('%d ',1,n) '\n'],a-b);
fprintf(fid,[repmat('%.2f ',1,n) '\n'],a./b);
fprintf(fid,[repmat('%d ',1,n) '\n'],a.*b);
fclose(fid);

Jérôme
.