MATLAB: Solving System of Marices

equationmatrices

Hi I need to solve following Matrix equation. Kindly help me
Di + Dg*X = X^2
where
Di=100*1 matrix (known)
Dg=100*100 matrix (known)
X=100*1 matrix (Unknown)
Is there any way to solve this kind of equation using MATLAB?

Best Answer

N = 100;
fun = @(x) x.^2 - Dg*x - Di;
x0 = zeros(N,1);
sol = fsolve(fun,x0)