[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #40467] cellfun ignores UniformOutput=false so
From: |
Markus Appel |
Subject: |
[Octave-bug-tracker] [bug #40467] cellfun ignores UniformOutput=false sometimes & needs doc update |
Date: |
Mon, 04 Nov 2013 09:46:23 +0000 |
User-agent: |
Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:25.0) Gecko/20100101 Firefox/25.0 |
URL:
<http://savannah.gnu.org/bugs/?40467>
Summary: cellfun ignores UniformOutput=false sometimes &
needs doc update
Project: GNU Octave
Submitted by: mappel
Submitted on: Mon 04 Nov 2013 09:46:23 AM GMT
Category: Octave Function
Severity: 3 - Normal
Priority: 5 - Normal
Item Group: Incorrect Result
Status: None
Assigned to: None
Originator Name:
Originator Email:
Open/Closed: Open
Discussion Lock: Any
Release: dev
Operating System: GNU/Linux
_______________________________________________________
Details:
cellfun presently has some issues:
(1)
For (most?) functions explicitly named in the documentation,
UniformOutput=false is ignored:
octave-gui:21> cellfun('isempty', {1 inf nan []}, "UniformOutput", false)
ans =
0 0 0 1
octave-gui:22> cellfun('isreal', {1 inf nan []}, "UniformOutput", false)
ans =
1 1 1 1
(2)
The documented function 'isclass' does not exist (has it been renamed to
'isobject'?)
octave-gui:23> cellfun('isclass', {1 inf nan}, "UniformOutput", false)
error: cellfun: not enough arguments for "isclass"
octave-gui:23> help isclass
error: help: 'isclass' not found
octave-gui:23> cellfun('isobject', {1 inf nan}, "UniformOutput", false)
ans =
{
[1,1] = 0
[1,2] = 0
[1,3] = 0
}
(3)
Personally, I find the documentation on "character string arguments" quite
confusing:
Additionally, `cellfun' accepts an arbitrary function FUNC in the form of an
inline function, function handle, or the name of a function (in a character
string). In the case of a character string argument, the function must accept
a single argument named X, and it must return a string value. The function
can take one or more arguments, with the inputs arguments given by C, D, etc.
The part about "must return a string value" does not seem to be required, but
the following form seems to be obsolete anyway:
octave-gui:26> cellfun('sin(x)', {1 2 inf nan}, "UniformOutput", false)
warning: cellfun: passing function body as a string is obsolete; please use
anonymous functions
ans =
{
[1,1] = 0.84147
[1,2] = 0.90930
[1,3] = NaN
[1,4] = NaN
}
Cheers,
Markus
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/bugs/?40467>
_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/
- [Octave-bug-tracker] [bug #40467] cellfun ignores UniformOutput=false sometimes & needs doc update,
Markus Appel <=