I have the following system of nonlinear equations in matlab:
function [ y ] = fnbeta( x, c, rest, alpha, LstarC, n, bstar, m )
y = zeros(n+c-1,1);
y(1) = sum( x( 1:(n+c-1)), 1 ) + sum(rest);
y(2) = sum( x( 1:(n+c-1), 1 ).^2 ) + sum( rest.^2 ) - m;
y(3) = x( 1:(n+c-1), 1 )' * alpha( 1:(n+c-1) ).^2 + ...
rest' * alpha((n+c):m).^2 - m * bstar(c);
for j=4:(4+c-2)
y(j) = x(1:(n+c-1), 1)' * LstarC( 1:(n+c-1), j-3 ) + ...
rest' * LstarC((n+c):m, j-3);
end
end
I am trying to solve it in the following code by setting parameters and solving for x.
n = 4;
c = 2;
m = 10;
rest = [0.4089769; 0.8830174; 0.9404673; 0.0455565; 0.5281055];
alpha = [-0.751574; -1.763454; 2.515028; 0; 0; 0; 0; 0; 0; 0];
LstarC = [ -0.751574,0,0,0;
-1.763454,0,0,0; ...
2.515028,0,0,0; ...
0,0,0,0; ...
0,0,0,0; ...
0,0,0,0; ...
0,0,0,0; ...
0,0,0,0; ...
0,0,0,0; ...
0,0,0,0];
bstar = [1.000000e+00; 5.551115e-17; 0.000000e+00; 0.000000e+00];
xstart =ones(n+c-1, 1);
f = @(x) fnbeta( x, c, rest, alpha, LstarC, n, bstar, m );
xval = fsolve(f,xstart)
Unfortunately matlab does not solve and gives me the following traceback:
Solver stopped prematurely.
fsolve stopped because it exceeded the function evaluation limit,
options.MaxFunctionEvaluations = 500 (the default value).
I know it can be solved since somebody else did it in R

Using these values I can also evaluate my matlab system to be zero.
What does singular in the context of solving a system of nonlinear equations mean?
Any idea which matlab function should be used for my task or how I can update my task to be solvable by fsolve?
Any suggestions on tags I should use to target the right audience?