[bug #68442] arrayfun not working on arrays of objects
"A.R. Burgers" <[email protected]> Fri, 12 Jun 2026 04:38:46 -0400 (EDT)
| Newsgroups | gmane.comp.gnu.octave.bugs |
|---|---|
| Message-ID | <[email protected]> |
Please use the bug tracker to post updates to a bug report. The mailing list is intended as a read-only notification stream. Info posted to this mailing list address won't appear in the tracker database where it is most useful.
URL:
<https://savannah.gnu.org/bugs/?68442>
Summary: arrayfun not working on arrays of objects
Group: GNU Octave
Submitter: arb
Submitted: Fri 12 Jun 2026 10:38:42 AM CEST
Category: Octave Function
Severity: 3 - Normal
Priority: 5 - Normal
Item Group: Unexpected Error or Warning
Status: None
Assigned to: None
Originator Name:
Originator Email:
Open/Closed: Open
Discussion Lock: Unlocked
Release: dev
Operating System: Any
Fixed Release: None
Planned Release: None
_______________________________________________________
Follow-up Comments:
-------------------------------------------------------
Date: Fri 12 Jun 2026 10:38:42 AM CEST By: A.R. Burgers <arb>
arrayfun fails on object arrays.
Searching the bugs on arrayfun I found bug #60680, which is related, but
different. Still I suspect this has been reported before.
class c_tst.
classdef c_tst
properties
name;
end
methods
function obj = c_tst(arg)
obj.name = arg;
end
end
end
script tst.m to exercise
c_a = c_tst('number1');
c_a(end + 1) = c_tst('number2');
c_a(end + 1) = c_tst('number3');
{c_a.name}
arrayfun(@(x) x.name, c_a, 'UniformOutput', false);
output of tst.m
ans =
{
[1,1] = number1
[1,2] = number2
[1,3] = number3
}
error: can't perform indexing operations for object type
error: called from
tst at line 7 column 1
_______________________________________________________
Reply to this item at:
<https://savannah.gnu.org/bugs/?68442>
_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/
signature.asc
(application/pgp-signature, 228 B)
-----BEGIN PGP SIGNATURE----- iHUEABYIAB0WIQQk97aszIMMAvLLwm6qLAuaBUf3TgUCaivFlgAKCRCqLAuaBUf3 Tv7lAQCWMaQipsjLLu9QGJRhvOGq55vfDejeuGrs4yS6tXkoIgEAuJvZpRNtD87O WaAL3+LNmTHcB3LM/Dq4qe5jSIMZvA8= =bLav -----END PGP SIGNATURE-----