-In Octave it is possible to apply indexing on a temporary expression, a feature that prohibited in MATLAB and this feature is very useful for golfing.
example:
Octave: [1 23 4 5 7](3:4)
and its MATLAB equivalent: a=[1 23 4 5 7];a(3:4)
Octave: hilb(4)(4:5,4:5)
and its MATLAB equivalent: h=hilb(4);h(4:5,4:5)
Octave: {1,4,{4 5 6},[7 ;3]}{3}
and its MATLAB equivalent: a={1,4,{4 5 6},[7 ;3]};a{3}
Octave: num2cell([1 2 3 4]){:}
for creation of comma separated list
Octave: a'(:)'
-Sometimes in an anonymous function as of a normal function we require to evaluate multiple expressions,that include assignment,
One approach is that we can place each expression in a cell(since cell can contain object of multiple types ) and when we need the value of each expression we can use indexing to extract that element.
{1,4,{4 5 6},[7 ;3]}{3}
or
{a=1,b=4,c={4 5 6},[b ;3]}{4}
2
Related, but not a duplicate: Tips for golfing in MATLAB
– Dennis Jaheruddin – 2014-01-29T10:16:18.390