hp prime programing with symbolic matrix - Printable Version +- HP Forums (https://www.hpmuseum.org/forum) +-- Forum: HP Calculators (and very old HP Computers) (/forum-3.html) +--- Forum: HP Prime (/forum-5.html) +--- Thread: hp prime programing with symbolic matrix (/thread-9608.html) |
hp prime programing with symbolic matrix - kain_x_x - 12-01-2017 01:33 PM 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. RE: hp prime programing with symbolic matrix - Fortin - 12-01-2017 02:25 PM Is this what you are trying to do? z:=[[1,2],[3,4]] z(1,1):=quote(x+2) RE: hp prime programing with symbolic matrix - kain_x_x - 12-02-2017 12:02 AM 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 :/ RE: hp prime programing with symbolic matrix - Helge Gabert - 12-02-2017 02:25 AM 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. RE: hp prime programing with symbolic matrix - kain_x_x - 12-18-2017 12:22 PM 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. RE: hp prime programing with symbolic matrix - Rudi - 12-18-2017 08:26 PM 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 RE: hp prime programing with symbolic matrix - Didier Lachieze - 12-18-2017 10:17 PM Or you can try with something like: CAS("matrix(2,2,(j,k)→c(j+k))") Solved: hp prime programing with symbolic matrix - Rudi - 12-19-2017 03:05 PM 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 |