help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: Writing text to a separate text file during execution


From: chris.potvin
Subject: RE: Writing text to a separate text file during execution
Date: Wed, 27 Feb 2013 06:06:34 -0800 (PST)

Thanks a lot!  That worked splendidly.

 

Chris Potvin, Ph.D., P.Eng.

Senior Process Engineer

Civil

Tel.: 902-492-4544 x 255

SNC-Lavalin Environment

NOTICE - This email message, and any attachments, may contain information or material that is confidential, privileged and/or subject to copyright or other rights. Any unauthorized viewing, disclosure, retransmission, dissemination or other use of or reliance on this message, or anything contained therein, is strictly prohibited and may be unlawful. If you believe you may have received this message in error, kindly inform the sender by return email and delete this message from your system. Thank you.

 

 

From: bpabbott [via Octave] [mailto:[hidden email]]
Sent: Wednesday, February 27, 2013 9:50 AM
To: Potvin, Chris
Subject: Re: Writing text to a separate text file during execution

 

On Feb 27, 2013, at 8:44 AM, chris.potvin wrote:


> I need to provide feedback from my octave script on the status of variables.
> Can someone please help me to write to a text file during execution?
> Ideally, the text file contents would look something like this:
>
> Variable y = 5
> Variable z = 9
> etc.
>
> Thanks in advance,
> Chris



Does this work for you?

x = 5;
y = 9;
fid = fopen ("yourfile.txt");
fprintf (fid, "Variable x = %s\n", num2str (x));
fprintf (fid, "Variable y = %s\n", num2str (y));
fclose (fid)

Ben
_______________________________________________
Help-octave mailing list
[hidden email]
https://mailman.cae.wisc.edu/listinfo/help-octave


If you reply to this email, your message will be added to the discussion below:

http://octave.1599824.n4.nabble.com/Writing-text-to-a-separate-text-file-during-execution-tp4650317p4650318.html

To unsubscribe from Writing text to a separate text file during execution, click here.
NAML



View this message in context: RE: Writing text to a separate text file during execution
Sent from the Octave - General mailing list archive at Nabble.com.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]