Doing it by matrix division (the mldivide function) did not work because the rows are not consistent.
The only solution I can come up with is:
syms qd td ed q teta
E =[ ed*cos(q)*sin(teta) - cos(teta)*(qd*cos(q)*sin(teta) + td*cos(teta)*sin(q)) - td*sin(q)*sin(teta)^2 ; cos(teta)*(td*cos(teta)*sin(q) - qd*sin(q)*sin(teta)) + ed*sin(q)*sin(teta) + td*cos(q)*sin(teta)^2 ; ed*cos(teta) + cos(q)*sin(teta)*(qd*cos(q)*sin(teta) + td*cos(teta)*sin(q)) - sin(q)*sin(teta)*(td*cos(teta)*sin(q) - qd*sin(q)*sin(teta))];
v = [qd;td;ed];
for k1 = 1:size(E,1)
C{k1} = coeffs(E(k1), v);
end
Out = [C{1}; C{2}; C{3}]
The columns of ‘Out’ are with respect to the elements of ‘v’, in order. Change the order of ‘v’ to produce the result you want.
Best Answer