On 05/26/2013 03:32 PM, Jannick wrote:
> Hi,
>
> working with wxMaxima 12.04.0 "addrow" does not append any rows in loops:
>
> block(
> M:matrix([0,0]),
> for i:1 thru 10 do addrow(M,[0,i]),
> print(M)
> );
>
> Any ideas? I must admit that I am a newbie to wxMaxima.
>
addrow() doesn't modify the original matrix, but it returns another one with
the added row:
(%i2) M:matrix([0],[1])$
(%i3) addrow(M,[2]);
(%o3) matrix([0],[1],[2])
(%i4) M;
(%o4) matrix([0],[1])
(I used display2d:false to print in this form instead of what you're probably
used to seeing).
Using instead M:addrow(M,[0,i]) inside your for loop should do the trick.
Cheers,
Kris Katterjohn