[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #40296] Consistent matrix return sizes
From: |
Rik |
Subject: |
[Octave-bug-tracker] [bug #40296] Consistent matrix return sizes |
Date: |
Tue, 4 Jun 2019 11:56:09 -0400 (EDT) |
User-agent: |
Mozilla/5.0 (Windows NT 10.0; WOW64; Trident/7.0; rv:11.0) like Gecko |
Update of bug #40296 (project octave):
Status: None => Wont Fix
Open/Closed: Open => Closed
_______________________________________________________
Follow-up Comment #2:
Introducing a huge discontinuity with Matlab is not something we want to do.
But there are workarounds that are not onerous. For the example code in
comment #0 fails depending on the orientation of m.
[i,j] = find(m);
inds = [i,j]';
for b = inds
r = inds(1)
c = inds(2)
# Do something with r and c
endfor
This can be rewritten, modestly, to
[i,j] = find(m);
inds = [i(:),j(:)];
for b = inds
r = inds(1)
c = inds(2)
# Do something with r and c
endfor
which will always work in both Octave and Matlab.
_______________________________________________________
Reply to this item at:
<https://savannah.gnu.org/bugs/?40296>
_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Octave-bug-tracker] [bug #40296] Consistent matrix return sizes,
Rik <=