Matrix to Vector
|
04-14-2023, 10:11 AM
(This post was last modified: 04-14-2023 10:27 AM by Amer7.)
Post: #1
|
|||
|
|||
Matrix to Vector
Hi,
I'm facing some issues again around matrices. When I multiply two matrices and the product of a matrix is [1,1] Matrix, I want to turn this Matrix to a Vector [1]. lets say M22 is my matrix [1,1] when i type M23:=vector(M22); It doesn't work, why I need this vector is to be able to be able to multiply matrix by a vector. - And later view the Values in Matrix editor Using EDITMAT() Like In Matrix menu - There is an option to Edit, Delete, Vect, Send When You press Vect it vectorises the matrix turning it [1] I need this, but what is the programing command? Because when I use M22[1,1] in this form Ss0:=M22[1,1]; M75:=M20*Ss0; EDITMAT(M75,"Matrix product of M20 and Ss0"); I get Input Error |
|||
04-14-2023, 12:20 PM
Post: #2
|
|||
|
|||
RE: Matrix to Vector
Use the REDIM command. E.g. REDIM( [[ 11,22,33 ]] , 3) yields [ 1,2,3 ]. See the built-in Help screen for more info about REDIM.
<0|ΙΈ|0> -Joe- |
|||
04-15-2023, 10:04 AM
(This post was last modified: 04-15-2023 01:50 PM by Amer7.)
Post: #3
|
|||
|
|||
RE: Matrix to Vector
(04-14-2023 12:20 PM)Joe Horn Wrote: Use the REDIM command. E.g. REDIM( [[ 11,22,33 ]] , 3) yields [ 1,2,3 ]. See the built-in Help screen for more info about REDIM. Thank you very much it works perfectly Basically If I want exp. Matrix M57 to be a vector ie. 1x1 REDIM(57,1); Example: Local M11,M57; M11:=M1xM2; M57:=REDIM(M11,1); EDITMAT(M57, "vector matrix value is this"); Just a precaution If you were to Multiply this REDIM(57) "vector" and you get like invalid size, input error etc. Do it like M1*M57(1); Works like aCharm, Thank you! |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 3 Guest(s)