[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #65228] matlab for loops on empty row vector
From: |
John W. Eaton |
Subject: |
[Octave-bug-tracker] [bug #65228] matlab for loops on empty row vector |
Date: |
Tue, 30 Jan 2024 09:12:11 -0500 (EST) |
Follow-up Comment #2, bug#65228 (group octave):
Yes, please see comment #6 of bug #50893 where Rik wrote
When an object has columns, but no rows, Octave iterates over the columns
while Matlab does not iterate. Sample code [...]
Was that incorrect, or did Matlab behavior behavior change recently?
I think the fix would be quite simple:
diff --git a/libinterp/parse-tree/pt-eval.cc
b/libinterp/parse-tree/pt-eval.cc
--- a/libinterp/parse-tree/pt-eval.cc
+++ b/libinterp/parse-tree/pt-eval.cc
@@ -3187,7 +3187,7 @@ tree_evaluator::visit_simple_for_command
if (rhs.ndims () > 2)
arg = arg.reshape (dv);
- if (nrows > 0 && steps > 0)
+ if (steps > 0)
{
octave_value_list idx;
octave_idx_type iidx;
Whether or not this is a recent change in behavior, but especially if it is,
could someone verify the other behavior noted in comment #6 of bug #50893?
_______________________________________________________
Reply to this item at:
<https://savannah.gnu.org/bugs/?65228>
_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/
- [Octave-bug-tracker] [bug #65228] matlab for loops on empty row vector, A.R. Burgers, 2024/01/30
- [Octave-bug-tracker] [bug #65228] matlab for loops on empty row vector, Markus Mützel, 2024/01/30
- [Octave-bug-tracker] [bug #65228] matlab for loops on empty row vector,
John W. Eaton <=
- [Octave-bug-tracker] [bug #65228] matlab for loops on empty row vector, Nicholas Jankowski, 2024/01/30
- [Octave-bug-tracker] [bug #65228] matlab for loops on empty row vector, Markus Mützel, 2024/01/30
- [Octave-bug-tracker] [bug #65228] matlab for loops on empty row vector, Rik, 2024/01/30
- [Octave-bug-tracker] [bug #65228] matlab for loops on empty row vector, Nicholas Jankowski, 2024/01/30