Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am working in MATLAB and having problem in extraction of coefficients out of my set of symbolic linear equations. Equations are as such

R =

[0.8978*c - 0.8047*b - 0.020299*a,  0.8978*d - 0.094800*b - 0.106799*a]

[ 0.091199*a + 0.13200*c - 0.8047*d, 0.091199*b - 0.106799*c + 0.0575*d]

How I can get the coefficient matrix, that is my result will look like

R_coeff =

 -0.0203   -0.8047    0.8978         0
 -0.1068   -0.0948         0    0.8978
  0.0912         0    0.1320   -0.8047
       0    0.0912   -0.1068    0.0575


share|cite|improve this question
@macydanim , can you please write steps using the following function? Because I am not able to do with it. – Salman Jan 25 '13 at 11:37

Using function subs should do the work:

res = subs(R,{a,b,c,d},{[1,0,0,0],[0 1 0 0],[0 0 1 0],[0 0 0 1]})

and then you have to play with the order to get it in the matrix format you want, e.g.,

R_coeff = [res(1,1:4);res(1,5:8);res(2,1:4);res(2,5:8)]
share|cite|improve this answer

you can take derrivative according to a (b) (c) to get coefficient according to a(b) (c) and form your own matrice,

or you can use coeffs function and also form your own matrix.

share|cite|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.