×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Write Matlab Output in a file

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...

RE: Write Matlab Output in a file

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
http://www.geocities.com/bstex2001

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources