Hi guys.
I'm trying to make a program with symbolic matrix.
My steps are the next:
first I make a matrix with zeros.
Then i tried to input in each element of the matrix an expresion in a for loop:
(z(i):=z(i)*(("X")-a(j)));
No mather if i put a "x" or an "X". I return from the program "incorrect argument"
If I put:
CAS (z(i):=z(i)*(("X")-a(j)));
then x will be replaced by zero because x haven't a value yet ( i don't want a value at all).
How can I make a matrix with symbolic elements?
Thanks in advance.
Is this what you are trying to do?
z:=[[1,2],[3,4]]
z(1,1):=quote(x+2)
yes it's that (i didn't knew that function at all) but it says samething. I tried it in the simplest way:
z(1,1):=quote(X);
same return... Incorrect argument :/
Are you writing a CAS program?
Works here, e.g. with
z:=MAKEMAT(QUOTE(x),n,m);
or variants of this -- look up help for MAKEMAT -- as the central statement within the CAS program, and n and m the number of rows and columns of the desired matrix, respectively.
Hello.
Sorry for this long long long delay.
No, I'm not writing a CAS mode program. It's a normal program where I'm triying to make some cas operations.
Now Im triying with:
z:=cas(MAKEMAT(1,"c(2)"));
It says that the code is fine, but when I'm runing the program it returns that it's a bad argument value (without stop the program).
what I'm trying to do:
Make a matrix considered as symbolic matrix where i can put some symbolic elements.
For example. In Matlab y can type:
Z=sym(ones(1,m)) to make an ones matrix considered as symbolic to put all type elements.
What it returns:
bad argument value.
Thanks for your help and again, sorry for the delay.
Dear all
Is that a possible solution?
list2mat(mat2list(seq("x"+string(k),k = (0 .. 8))),3)
[["x0","x1","x2"],["x3","x4","x5"],["x6","x7","x8"]]
I do not have the option to change the strings in quotes or symbolics.
Best Regards
Rudi
Or you can try with something like: CAS("matrix(2,2,(j,k)→c(j+k))")
Dear all
I think, that I've solved this Problem.
Only in CAS-View:
restart // purge all CAS-Variables or use purge()
list2mat(mat2list(seq(expr("x"+string(k)),k = (0 .. 8))),3);
// StartValue is 0 i.e. x0
// EndValue is 8 i.e. x8
// Columns of the Matrix is 3
Result:
[[x0,x1,x2],[x3,x4,x5],[x6,x7,x8]]
Only to Info:
Save Values to the Variables
[[x0,x1,x2],[x3,x4,x5],[x6,x7,x8]]:=[[1,2,3],[4,5,6],[7,8,9]]
Best Regards
Rudi