How does Octave shine?
qspencer at ieee.org
Wed Sep 20 20:56:42 CDT 2006
Jordi Gutierrez Hermoso wrote:
> On 20/09/06, Cameron Laird <Cameron at phaseit.net> 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:
y = x(51);
More information about the Help-octave