help-octave
[Top][All Lists]
Advanced

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

Re: numel(foo{:}) - feature or bug ?


From: fork
Subject: Re: numel(foo{:}) - feature or bug ?
Date: Fri, 5 Aug 2011 17:11:39 +0000 (UTC)
User-agent: Loom/3.14 (http://gmane.org/)

Sergei Steshenko <sergstesh <at> yahoo.com> writes:

> And zero instead of three is _nonsense_ to me. Call me dumb.
> 
> ...
> 
> I think 'octave' should have a 'enable_stupid_matlab_bugs' flag.

The utility of the matlab compatible behavior is that one can loop over an N x M
cell array that holds complex parameter sets (including structs and large
matrices) as columns and feed each parameter set to a function.  Like so
(admittedly trivial):

x = {1 2 ; 3 4 }
f = @(x,y) x+y
for p = x
    f(p{:})
endfor

As a general rule, I would give matlab syntax the benefit of the doubt and try
to figure out why it was chosen, rather than file bug reports about how it
should be changed.

This is not to say there wouldn't be utility in the approach you advocate, and
perhaps it would be a useful extension.




reply via email to

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