octave-maintainers
[Top][All Lists]
Advanced

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

Re: mapper functions vs. cell arrays


From: John W. Eaton
Subject: Re: mapper functions vs. cell arrays
Date: Thu, 31 Aug 2006 13:14:31 -0400

On 31-Aug-2006, David Bateman wrote:

| John W. Eaton wrote:
| > Should we be bug-for-bug compatible here, or should we do something
| > that is more consistent?  I think we should do one of the following:
| >
| >   * Change all the mapper functions so that
| >
| >       mapper (CELL) == cellfun (@MAPPER, CELL)
| >
| >   
| I prefer this solution. Programs that work in matlab then work in octave
| and we have a consistent interface...

OK.

Well, the current implementation of cellfun in Matlab is more complex
than what we have in Octave.  For example,

Matlab gives an error for this

  cellfun (@upper, {'foo'; 'foobar'})

but not this

  cellfun (@upper, {'foo'; 'foobar'}, 'UniformOutput', false)

and both of these

  cellfun (@upper, {'f', 'o', 'o'})
  cellfun (@upper, {'f', 'o', 'o'}, 'UniformOutput', true)

return

  "FOO"

while

  cellfun (@upper, {'f', 'o', 'o'}, 'UniformOutput', true)

returns a cell array of characters.

There is also a new ErrorHandler parameter that allows one to specify
a function to call if the mapper fails.

Ugh.  Is there any function in Matlab that is not aqcuiring a lot of
twisty little features?

jwe


reply via email to

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