Solving Nonlinear Matrix Equation
Mostrar comentarios más antiguos
I have an equation of the form
where A= positive definite symmetrix matrix (2 by 2), X is data matrix of dimensions (N by 2) and mu is a vector (1 by 2). Ki are scaler values and P is a constant. I want to use fsolve to solve for mu.
I am using the script as below
K_values in the code is an array that contains the values of each Ki.
data in the code is a ( N by 2 ) matrix of values that is passed on to the script below
The matrix A is calculated before running the script. The only unknown is the vector mu.
fsolve returns an error: Not enough input arguments
Any insight into solving this is highly appreciated.
syms X [length(data) 2]
syms mu [1 2]
syms K
T=subs(trace(inv(A)*(X-mu)'*(X-mu))^(P),X,data);
L1=subs(K*T,{K},{[K_values]});
fun1=matlabFunction(sum(L1));
mu0=[1;1];
options = optimoptions('fsolve','Display','none');
mu=fsolve(fun1,mu0,options);
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Common Operations en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!