help-octave
[Top][All Lists]
Advanced

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

Re: Problem with single quotes


From: Søren Hauberg
Subject: Re: Problem with single quotes
Date: Thu, 02 Oct 2008 16:40:31 +0200

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
> address@hidden
> https://www-old.cae.wisc.edu/mailman/listinfo/help-octave



reply via email to

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