Hello!
I'm really disordered in this difference.
How can I write the matrix on function? I try this:
(%i28) func(n,m):=for i:1 thru n do for j:1 thru m do A[i,j]:i+j$
(%i29) A;
(%o29) A
(%i30) A[1,2];
(%o30) 3
But what is A? Matrix? Array?
I tried to define matrix with array's help:
(%i8) func(n,m):=(array(A,flonum,n,m),for i:1 thru n do for j:1 thru m do A[i,j]:i+j,M:genmatrix(A,n,m))$
(%i9) func(4,4);
Element and array type do not match:
1234
#0: func(n=4,m=4)
-- an error. To debug this try debugmode(true);
But without success :(
I need to define all elements of matrix in function - How can I do this?
--
Mansur Marvanov <nanorobocop at gmail.com>