Extracting values from vectors/matrices in home
|
02-24-2016, 04:06 PM
(This post was last modified: 02-24-2016 04:07 PM by Han.)
Post: #4
|
|||
|
|||
RE: Extracting values from vectors/matrices in home
Just save your vector or matrix into ad global variable. For example:
M1:=proot( [1,5,6] ); // now M1 contains the vector [-3 -2] M1[1] returns -3 and M1[2] returns -2 For matrices, use M1[m,n] to extract the element in row m and column n. You can optionally use the following syntax: M1(1) and M1(2), or M1(m,n) for a matrix but I do not recommend this syntax because (esp. in CAS programs) it is not clear if something like: myvar(m,n) should be interpreted as a 2-variable function myvar with inputs m and n, or as the m,n entry of a matrix named myvar. I know you specified not using variables, but global variables exist whether you use them or not, so I say go ahead and use them. Graph 3D | QPI | SolveSys |
|||
« Next Oldest | Next Newest »
|
Messages In This Thread |
Extracting values from vectors/matrices in home - retoa - 02-24-2016, 10:15 AM
RE: Extracting values from vectors/matrices in home - DrD - 02-24-2016, 12:34 PM
RE: Extracting values from vectors/matrices in home - Didier Lachieze - 02-24-2016, 01:05 PM
RE: Extracting values from vectors/matrices in home - Han - 02-24-2016 04:06 PM
RE: Extracting values from vectors/matrices in home - retoa - 02-25-2016, 08:05 AM
RE: Extracting values from vectors/matrices in home - retoa - 02-25-2016, 08:27 AM
|
User(s) browsing this thread: 1 Guest(s)