help-octave
[Top][All Lists]
Advanced

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

Re: printf and fprintf for "%"


From: Keith Goodman
Subject: Re: printf and fprintf for "%"
Date: Sun, 29 May 2005 08:19:00 -0700

On 5/29/05, Jun Ohta <address@hidden> wrote:
> >> a = "%"
> a = %
> >> printf(a)
> error: fprintf: invalid format specified
> error: evaluating assignment expression near line 35, column 12
> error: evaluating if command near line 34, column 3
> error: called from `printf' in file
> `/usr/local/share/octave/2.1.50/m/io/printf.m'
> >>

You forgot to tell printf how to format the string:

>> a="%"
a = %
>> printf("%s",a)
%>> printf("%s\n",a)
%



-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.

Octave's home on the web:  http://www.octave.org
How to fund new projects:  http://www.octave.org/funding.html
Subscription information:  http://www.octave.org/archive.html
-------------------------------------------------------------



reply via email to

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