help-octave
[Top][All Lists]
Advanced

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

Re: Output format problem


From: Nicholas Jankowski
Subject: Re: Output format problem
Date: Mon, 20 Sep 2021 11:07:30 -0400

On Mon, Sep 20, 2021 at 7:18 AM Samuel Doughty <sdoughty11@gmail.com> wrote:
I want to print three items on a single line: an integer, a name, and a floating point value using the printf statement. Call them nn, name, and value. How do I write this command?



There are a couple examples of using printf in the Octave manual.  See:
https://octave.org/doc/latest/Formatted-Output.html 

for example:
pct = 37;
filename = "foo.txt";
printf ("Processed %d%% of '%s'.\nPlease be patient.\n",
        pct, filename);

so, it seems you would use something like

printf (" integer %d, name %s, value %g", nn, name, value);

for syntax see https://octave.org/doc/v6.3.0/Table-of-Output-Conversions.html


reply via email to

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