Problem with single quotes

James Sherman Jr. shermanj at umd.edu
Thu Oct 2 11:29:00 CDT 2008


> > | >  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.
> >
> > No, it should print a single ' character, same as Matlab.
>
> I can only report what I see. I've tried it on Octave 3.0.2 (OS X) and
> Octave 3.0.0 (Ubuntu Hardy). Both give me a double quote.
>
> > | I'll give it a shot in Matlab and see what happens.
>
> A colleague just tried it on Matlab and got a double quote as well.
>

I just tried this in matlab version 7.5.0.342 and got a single quote.

Just to precise there are 4 single ' characters inside the brackets in
fprintf('''') statement.

James
-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://www-old.cae.wisc.edu/pipermail/help-octave/attachments/20081002/9d3ed8bc/attachment.html 


More information about the Help-octave mailing list