[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #53765] "reverse" argument for cumsum for Matl
From: |
Rik |
Subject: |
[Octave-bug-tracker] [bug #53765] "reverse" argument for cumsum for Matlab compatibility |
Date: |
Fri, 27 Apr 2018 13:17:59 -0400 (EDT) |
User-agent: |
Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:55.0) Gecko/20100101 Firefox/55.0 |
Update of bug #53765 (project octave):
Category: None => Octave Function
Priority: 5 - Normal => 3 - Low
Item Group: Feature Request => Matlab Compatibility
Status: None => Confirmed
Summary: reverse cumulative sum => "reverse" argument for
cumsum for Matlab compatibility
_______________________________________________________
Follow-up Comment #2:
Marking as confirmed, and changing the category to "Matlab Compatibility".
I'm lowering the priority since there are easy workarounds.
You can't use linear indexing, because it will convert matrices to vectors,
but you can use flip.
A suitable replacement is
r = flip (cumsum (flip (dat)))
If you are working on a specific dimension which is not the first singleton
dimension then you have to give that dimension as an argument to both flip and
cumsum (which you would have to do anyways).
r = flip (cumsum (flip (dat, dim), dim), dim)
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/bugs/?53765>
_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/