output question

View: New views
4 Messages — Rating Filter:   Alert me  

output question

by AlexRSS :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

An unbelievably ignorant question, but when I run Octave from the terminal in OSX and call a function that outputs data using printf, the values are only printed to the terminal after the function has finished running.  How can I get Octave to print values to the terminal as a function is running (i.e., print the value to the terminal as the statement is evaluated while the function runs rather than printing all the values at the end of the function?

Re: output question

by dbateman2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

AlexRSS wrote:
> An unbelievably ignorant question, but when I run Octave from the terminal in
> OSX and call a function that outputs data using printf, the values are only
> printed to the terminal after the function has finished running.  How can I
> get Octave to print values to the terminal as a function is running (i.e.,
> print the value to the terminal as the statement is evaluated while the
> function runs rather than printing all the values at the end of the
> function?
>  
Try "more off" or add "fflush(stdout)" after the printf calls

D.

--
David Bateman                                dbateman@...
35 rue Gambetta                              +33 1 46 04 02 18 (Home)
92100 Boulogne-Billancourt FRANCE            +33 6 72 01 06 33 (Mob)

_______________________________________________
Help-octave mailing list
Help-octave@...
https://www-old.cae.wisc.edu/mailman/listinfo/help-octave

Re: output question

by AlexRSS :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

David,

Thanks so much, fflush works like a charm.  I appreciate your help.

-- Alex

David Bateman-2 wrote:
AlexRSS wrote:
> An unbelievably ignorant question, but when I run Octave from the terminal in
> OSX and call a function that outputs data using printf, the values are only
> printed to the terminal after the function has finished running.  How can I
> get Octave to print values to the terminal as a function is running (i.e.,
> print the value to the terminal as the statement is evaluated while the
> function runs rather than printing all the values at the end of the
> function?
>  
Try "more off" or add "fflush(stdout)" after the printf calls

D.

--
David Bateman                                dbateman@dbateman.org
35 rue Gambetta                              +33 1 46 04 02 18 (Home)
92100 Boulogne-Billancourt FRANCE            +33 6 72 01 06 33 (Mob)

_______________________________________________
Help-octave mailing list
Help-octave@octave.org
https://www-old.cae.wisc.edu/mailman/listinfo/help-octave

Re: output question

by helloman :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Thank you very much Alex, for the reply. I also have the same issue with nested loops and wanted to check the status of the simulation.



David,

Thanks so much, fflush works like a charm.  I appreciate your help.

-- Alex

David Bateman-2 wrote:
AlexRSS wrote:
> An unbelievably ignorant question, but when I run Octave from the terminal in
> OSX and call a function that outputs data using printf, the values are only
> printed to the terminal after the function has finished running.  How can I
> get Octave to print values to the terminal as a function is running (i.e.,
> print the value to the terminal as the statement is evaluated while the
> function runs rather than printing all the values at the end of the
> function?
>  
Try "more off" or add "fflush(stdout)" after the printf calls

D.

--
David Bateman                                dbateman@dbateman.org
35 rue Gambetta                              +33 1 46 04 02 18 (Home)
92100 Boulogne-Billancourt FRANCE            +33 6 72 01 06 33 (Mob)

_______________________________________________
Help-octave mailing list
Help-octave@octave.org
https://www-old.cae.wisc.edu/mailman/listinfo/help-octave