[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #55622] for loop does not run over a matrix wi
From: |
Kai Torben Ohlhus |
Subject: |
[Octave-bug-tracker] [bug #55622] for loop does not run over a matrix with colums but no row |
Date: |
Sun, 29 Nov 2020 22:28:41 -0500 (EST) |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.66 Safari/537.36 |
Follow-up Comment #21, bug #55622 (project octave):
Regarding comment #20. Please fix your confusion with a cup of coffee
☕🙂
Your code cannot be run, as there is a confusion between "y" and "loop_var".
Clear your workspace "clear all" and start again.
loop_var = ones(3,1)
isempty(loop_var)
size(loop_var)
for var = loop_var, disp('hey'), disp(var), end
Second all this discussion is about "ones(0,3)", NOT "ones(3,1)" or alike. As
Rik said, please read again carefully. Your code of course works nicely with
a single loop iteration in both Octave and Matlab, as the column count is
"1".
No bugfixes by Matlab R2019a and R2020b yet.
>> for i = (3:2)', disp ('hey'), end
hey
>> for i = zeros (0,3), disp ('hey'), end
hey
hey
hey
>> for i = zeros (0, 3, 0), i, end
>> for i = ones (0,3), disp ('hey'), end
hey
hey
hey
>> for i = ones (3,0), disp ('hey'), end
I favor Riks opinion on this item too and suggest to close it as won't fix.
_______________________________________________________
Reply to this item at:
<https://savannah.gnu.org/bugs/?55622>
_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/