Write Matlab Output in a file
Write Matlab Output in a file
(OP)
Is it allowable using fprintf for a transfer function (command: tf )in Matlab? If not,could anyone tell me what else can I do so that I could have this transfer function in another file (e.g: Test.doc)
Furthermore, I would like to print a set of result in a file so that it looks like a table..
A B
12 6
3 8
6 19
Thank you for helping...
Furthermore, I would like to print a set of result in a file so that it looks like a table..
A B
12 6
3 8
6 19
Thank you for helping...





RE: Write Matlab Output in a file
For your second question try this:
>> header=['A B']; % note the blanks
>> M=[1 2; 3 4; 5 6];
>> fid=fopen('tryprint.txt','w');
>> fprintf(fid,'%s\n',header);
>> fprintf(fid,'%d %d\n',M); %note the blanks
>> fclose(fid)
Joe
BSTeX- Equation viewer for Matlab
http://www.geocities.com/bstex2001