Problem with single quotes
Søren Hauberg
soren at hauberg.org
Thu Oct 2 09:40:31 CDT 2008
tor, 02 10 2008 kl. 10:30 -0400, skrev Andreas Yankopolus:
> I'm trying to write some Octave code that's compatible with Matlab.
> One of the differences is that Matlab uses single quotation marks, and
> I quickly ran into problems with Octave's handling of them. The
> following command should print a single quotation mark, but it gives a
> syntax error:
>
> printf ('\'');
I doubt that'll work in Matlab either:
1) Matlab doesn't have the printf function -- you have to use fprintf
2) The escape code for ' inside a single quoted string is ''.
So, the following should work:
fprintf ('''')
Søren
>
> I'm running Octave 3.0.0 on Ubuntu Hardy installed via the package
> manger. The same problem occurs on Octave 3.0.2 on OS X installed via
> Fink.
>
> Am I doing something wrong? Is this a bug?
>
> Thanks,
>
> Andreas
>
> _______________________________________________
> Help-octave mailing list
> Help-octave at cae.wisc.edu
> https://www-old.cae.wisc.edu/mailman/listinfo/help-octave
More information about the Help-octave
mailing list