MATLAB: How tonvert functions with same input variables

calculusDatabase ToolboxEconometrics Toolboxeconomicsfinite element analysismathematicsOptimization ToolboxstatisticsStatistics and Machine Learning Toolbox

Dear Sirs, I want to invert following set of equations:
Y(i)=a(i)X1+b(i)X2+c(i)X3+d(i)X1X2+e(i)X1X3+f(i)X2X3+g(i)X1^2+h(i)X2^2+i(i)X3^2     i=[1,4]
It consists of four outputs (Y1-Y4), 3 inputs (X1-X3), and (9*4) coeff.
I intend to generate X1,X2,X3=function(Y1,Y2,Y3,Y4).i.e. Equations of X1,X2,X3. We may assume coefficients of your choice to simplify the solution. Please help me with possible guidance.

Best Answer

a=...;
b=...;
c=...;
d=...;
e=...;
f=...;
g=...;
h=...;
i=...;
y=...;
fun=@(x) a*x(1)+b*x(2)+c*x(3)+d*x(1)*x(2)+e*x(1)*x(3)+f*x(2)*x(3)+g*x(1)^2+h*x(2)^2+i*x(3)^2-y;
x0=[1 1 1];
sol=lsqnonlin(fun,x0);
Best wishes
Torsten.