I'm trying to numerically find the solution to X^2+X+C=0
where C is the matrix C=[-6,-5;0,-6]
and 0=[0,0;0,0]
, a quadratic equation where the variable is 2x2 matrix.
So I wrote the following matlab commands
C=[-6,-5;0,-6]
[X1,F,e_flag]=fsolve('X^2+X+C',[1,1;1,1])
where [1,1;1,1]
is our initial estimate, or X0
.
I'm getting the following errors
"Error using inlineeval (line 15) Error in inline expression ==> X^2+X+C Undefined function or variable 'X'.
Error in inline/feval (line 34) INLINE_OUT_ = inlineeval(INLINE_INPUTS_, INLINE_OBJ_.inputExpr, INLINE_OBJ_.expr);
Error in fsolve (line 218) fuser = feval(funfcn{3},x,varargin{:});
Caused by: Failure in initial user-supplied objective function evaluation. FSOLVE cannot continue."
How do I use fsolve to solve these kind of problems?