Problem with single quotes

Søren Hauberg soren at hauberg.org
Thu Oct 2 10:26:30 CDT 2008


tor, 02 10 2008 kl. 10:49 -0400, skrev Andreas Yankopolus:
> Søren,
> 
> > I doubt that'll work in Matlab either:
> >
> >  1) Matlab doesn't have the printf function -- you have to use fprintf
> 
> I've changed all my printf(…) statements to fprintf (1, …)

You don't need the 1 argument to fprintf. This is a Matlab weirdness:
they decided not to provide printf, instead they made the file pointer
argument to fprintf optional.

> >  2) The escape code for ' inside a single quoted string is ''.
> >
> > So, the following should work:
> >  fprintf ('''')
> 
> I did not know that. That statement prints a double quote in Octave.  
> I'll give it a shot in Matlab and see what happens.

That gives you a double quote in Octave? I get one single quote.

Søren



More information about the Help-octave mailing list