MATLAB: How to solve for the coefficients of a polynomial equation

coefficientconstantequationsmathspolynomialsimultaneoussolveunknowns

I have a formula here:
T=A+BI+CI^2+DI^3
where T and I are known and varies, and A,B,C,D are my unknown constants…
With 4 unknowns, I would need to provide 4 equations.
How may I write these in matlab in order to solve for A,B,C and D?

Best Answer

I=1;T=3
% A*y=b your equation with y=[A;B;C;D] are unknown variables
A=[1 1 I^2 I^3 % your first equation T=A+BI+CI^2+DI^3
1 3 4 5 % your second equation is A+3B+4C+5D=1
4 5 1 2
0 4 1 7]
b=[T;1;2;3]
y=A\b