Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations cowski on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Write Matlab Output in a file

Status
Not open for further replies.

schwerttrager

Electrical
Dec 28, 2002
1
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...
 
Replies continue below

Recommended for you

Hi,
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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor