|
From: | Andreas Yankopolus |
Subject: | Re: Problem with single quotes |
Date: | Thu, 2 Oct 2008 11:37:31 -0400 |
John,
You should not need to use fprintf (1, fmt, args, ...). You can just write fprintf (fmt, args, ...). This works because if the first argument to fprintf is a character string, it is used as the format and the default output stream is the standard output (stdout, or stream number 1).
Thanks. That will make for more readable code.
| > 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. Cheers, Andreas
[Prev in Thread] | Current Thread | [Next in Thread] |