octave-bug-tracker
[Top][All Lists]
Advanced

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

[Octave-bug-tracker] [bug #60680] arrayfun should support user-defined c


From: Mike Miller
Subject: [Octave-bug-tracker] [bug #60680] arrayfun should support user-defined class arrays that support linear indexing
Date: Thu, 27 May 2021 18:17:55 -0400 (EDT)
User-agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.77 Safari/537.36

URL:
  <https://savannah.gnu.org/bugs/?60680>

                 Summary: arrayfun should support user-defined class arrays
that support linear indexing
                 Project: GNU Octave
            Submitted by: mtmiller
            Submitted on: Thu 27 May 2021 03:17:53 PM PDT
                Category: Octave Function
                Severity: 1 - Wish
                Priority: 5 - Normal
              Item Group: Feature Request
                  Status: None
             Assigned to: None
         Originator Name: 
        Originator Email: 
             Open/Closed: Open
                 Release: dev
         Discussion Lock: Any
        Operating System: GNU/Linux

    _______________________________________________________

Details:

The built-in arrayfun function should support user-defined classes that can
implement arrays of objects.

An example is the @sym class in the symbolic package:


>> A = sym([1, 2, 3]);
>> numel (A)
ans = 3
>> size (A)
ans =

   1   3

>> A(1)
ans = (sym) 1
>> A(end)
ans = (sym) 3
>> arrayfun (@(x) pi, A)
ans = 3.1416



The last shows that arrayfun only returns 1 value, so it treats the @sym
object as a single scalar. It should return a 1×3 vector:


>> arrayfun (@(x) pi, double (A))
ans =

   3.1416   3.1416   3.1416







    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?60680>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

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