help-octave
[Top][All Lists]
Advanced

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

Re: How does Octave shine?


From: Steve C. Thompson
Subject: Re: How does Octave shine?
Date: Wed, 20 Sep 2006 22:45:02 -0700
User-agent: Mutt/1.5.11

On 20 Sep 06 20:56PM, Quentin Spencer wrote:
> Jordi Gutierrez Hermoso wrote:
> > On 20/09/06, Cameron Laird <address@hidden> wrote:
> >   
> > >  What shows Octave off to best advantage for a
> > >  Matlab-using audience?
> >
> > I can think of a couple of enhancements I
> > particularly enjoy:
> >
> > 1) "Better" syntax. By this I generally mean that I
> > find Octave just slightly more readable in that
> > allows for some mostly cosmetic enhancements like
> > endfunction, endfor, or endif instead of just a
> > plain end.
> >   
> I forgot about syntax differences. My favorite syntax
> enhancements are the C-style ++ += *= and /=
> operators. Another one is the ability to index the
> output of an expression. Suppose you wanted to find
> the median value of 101 random variables (ignoring
> that octave has a median function). In octave, you
> can do this:
> 
> y = sort(rand(1,101))(51);
> 
> In Matlab, this is a syntax error and requires two
> steps:
> 
> x=sort(rand(1,101));
> y = x(51);

Yeah, Octave has a more advanced parser than Matlab.
Some of these details are detailed here:
http://wiki.octave.org/wiki.pl?MatlabOctaveCompatibility

I like how in Octave, I can issue

  rand (1,
        2)

or

  rand (1, \
        2)

or 

  rand (1, ...
        2)

while Matlab only supports the last example.  This is
but one example of the seemingly thoughtless
idiosyncrasies found in Matlab that Octave has
overcome.

Steve


reply via email to

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