Question: Problems with coeffs function


I am trying to extract all the coefficients of a linear equation by calling coeffs function.

eq := 1.2*a[2]+1.3*a[3]+1.1*a[1]+1.0




vars := [seq(a[i], i = 1 .. 3)]

[a[1], a[2], a[3]]


coeffs(eq, vars)

1.0, 1.2, 1.3, 1.1



I expected I receive the coefficients in the same order as in vars variable, but I was wrong. How to extract coefficients in the order I need?



Please Wait...