MATLAB: System of Linear algebraic eqn. to matrix form

coeffslinear algebramatrix formsystem of equations

I would like to convert system of algebraic equation to Matrix form
I knew that in Mathematica "CoefficientsArray[expression,{x,y,z}]" will help me pull out those coefficients of unknowns and it can also arranges in order.
For ex. unknowns are x, y, z
eqn : 2x+3y=0
>>> then in Mathematica i can do [2 3 0] or even [3 0 2], my point is, it can manage the order . >>>However, so far in MATLAB that i knew, the cmd is "coeffs(expr)", i got [2 3] and that's it no 0 for z
Does anyone know how to assign an order as well as include 0 coefficient in the out put array?
Thk

Best Answer

I've got a sol. for those who are in the same situation
try using >>>subs()
for ex.
[subs(f,{x,y,z},{0,0,1}) subs(f,{x,y,z},{0,1,0}) subs(f,{x,y,z},{1,0,0})]
result is
ans = [0 3 2]