The identifier 'vfg' is a hashed array, not a matrix. You can convert 'vfg'
to
a Maxima matrix with
(%i18) funmake('matrix, listarray(vfg));
(%o18) matrix([613.125],[1226.25],[1226.25],[1226.25],[613.125])
The statement
genmatrix(vfg, nnt, 1); /* initialisation */
doesn't initialize 'vfg' to a matrix. Here are some examples of how to
construct a Maxima matrix:
(%i27) m1 : matrix([1,2],[3,4]);
(%o27) matrix([1,2],[3,4])
(%i28) m2 : genmatrix(lambda([i,j], i + j), 2, 2);
(%o28) matrix([2,3],[3,4])
(%i29) m3 : genmatrix('xxx, 2, 2);
(%o29) matrix([xxx[1,1],xxx[1,2]],[xxx[2,1],xxx[2,2]])
(%i30) m1 . m2 - m3;
(%o30) matrix([8-xxx[1,1],11-xxx[1,2]],[18-xxx[2,1],25-xxx[2,2]])
Maybe this helps---welcome to Maxima.
Barton
-----maxima-bounces at math.utexas.edu wrote: -----
>I am newbie in wxMaxima, and I have some problems with matrices, and
>don't find any help to solve them :
>
>
> after having changed some elements of a matrix, I would like to
>show its content. I didn't found another solution that using genmatrix
>function. Is there another way?
> when copying values of a matrix in another one, the result is
>within brakets and the resulting matrix is not recognised as a matrix
>by maxima. For example, if I try to copy it, I get an error.
>
>There is certainly a way to do what I want but I have been searching
>for three days unsuccessfully. If you could help me I would appreciate!
>
>I reproduce the code herebelow, if you want to figure out what happens.
>
>
>
>Thanks
>
>
>
>Philippe
>
>
>
>
>
>The code :
>
>********
>
>kill(all);
>
>
>
>nelt:4;
>
>LL:10;
>
>A:50;
>
>rho : 1;
>
>g : 9.81;
>
>L:LL/nelt;
>
>nnt : nelt+1;
>
>
>
>N:[1-x/L,x/L]; /* Fonctions de forme du champ d?placements elem*/
>
>Nt:transpose(N);
>
>vfe:integrate(Nt*A*rho*g,x,0,L);
>
>
>
>vfg[i,j]:=0;
>
>genmatrix(vfg, nnt, 1); /* initialisation */
>
>
>
>for ie:1 thru nelt do
>
> (konec[ie,1]:ie,
>
> konec[ie,2]:ie+1
>
> );
>
>
>
>for ie:1 thru nelt do
>
> (
>
> for in:1 thru 2 do
>
> (
>
> vfg[konec[ie,in],1] : vfg[konec[ie,in],1] + vfe[in]
>
> )
>
>
>
> );
>
>print(genmatrix(vfg, nnt, 1));
>
>vkg0:copymatrix(vkg);
>
>--
>Philippe BOERAEVE
>7 sur les heids
>B - 4053 EMBOURG
>BELGIUM
>
>tel.: +32 (0)4 367 14 31
>
>_______________________________________________
>Maxima mailing list
>Maxima at math.utexas.edu
>http://www.math.utexas.edu/mailman/listinfo/maxima