[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: For loops and column vectors
From: |
c. |
Subject: |
Re: For loops and column vectors |
Date: |
Sun, 17 Jul 2011 20:04:13 +0200 |
On 17 Jul 2011, at 19:00, address@hidden wrote:
> for i = [1:3]'
> disp (i);
> disp ("--");
> endfor
>
> Output:
> 1
> 2
> 3
> --
this behaviour is matlab compatible.
> In the second case the loop variable gets assigned the entire value of the
> column vector and the loop iterates just once.
that is what happens and is explained well in the matlab documentation.
maybe we should improve the "for" documentation in octave?
c.