MATLAB: Find the solutions of h(x)=(x^8+P(x))^2 which give local minimum (fminsearch)…..any help fminsearch i dont know what function i have to write and also when i write xmin=fminsearch(…..) what i must write inside the space?? Best Answer If P(x) is a 7-degree polynomial derived from polyfit:p = randi(9, 1, 7); % Create Data (Polynomial Coefficients)f = @(x,p) x.^8 + polyval(p,x).^2; % Functionx0 = 2; % Initial Estimate For āxā[xmin,fval] = fminsearch(@(x)f(x,p), x0); % Find MinimumYou have likely gotten āpā from something other than randi, but I had to create something to test the code. Related SolutionsMATLAB: Failure in initial objective function evaluation. FMINUNC cannot continue. Unless it is already in a function file, it needs to be an anonymous function: f = @(x) x(2)^2*x(9)^2 + x(2)^2*x(9) + x(2)^3*x(9) - x(3)*x(5)*x(9)^2 + x(6)*x(8)*x(9)^2 + x(6)*x(8)*x(9)^3 + x(2)*x(6)*x(8)*x(9)^2;If it is in a function file (and you have passed the function handle to fminunc correctly), the initial parameter estimates could be the problem. Please post those. MATLAB: Use “solution converged to an infeasible point” as an input Use the output exitflag to find out if there was no feasible point:[x,fval,exitflag,output] = fmincon(@(X) obj_function(X,P,Pd,intervalotiempo),X0,A,B,Aeq,Beq,LB,UB,nonlin);If the exitflag = -2 then there was no feasible point found. Related QuestionE^x/xNonlinear equations & fsolve. Error “Failure in initial objective function evaluation. FSOLVE cannot continue.”X=[x1(:,:) x1(:,:)]Fmincon
Best Answer