Creating a matrix
Publié : sam. févr. 26, 2011 6:35 pm
Is there a difference between creating matrix directly and using list2mat?
The following demonstrates what I found:
eq1:=m*(s^2*x-s*dx0-x0)+b*(s*x-x0)+k*x=0
vars:=[ m=2, b=8, k=26, xo=1, dx0=0 ] :;
vars1:=list2mat(vars,1)
subs(eq1,vars)
subs(eq1,vars1)
Note that substituting vars works, substituting vars1 does not.
Thank you,
Matt
The following demonstrates what I found:
eq1:=m*(s^2*x-s*dx0-x0)+b*(s*x-x0)+k*x=0
vars:=[ m=2, b=8, k=26, xo=1, dx0=0 ] :;
vars1:=list2mat(vars,1)
subs(eq1,vars)
subs(eq1,vars1)
Note that substituting vars works, substituting vars1 does not.
Thank you,
Matt