fsolve error: Failure in initial user-supplied objective function evaluation. FSOLVE cannot continue.

9 次查看(过去 30 天)
Can someone help me fix my function here? The error message I am getting is as above. My input is : c2=roots([1,-2*b2*cos(A2*pi/180),b2^2-b1^2-c1^2+2*b1*c1*cos(A1*pi/180)]);
for n=1:numel(c2)
if c2(n)>0 c2(n) end end %%
A1=120; A2=100; b1=180; b2=165; c1=115;
type quadrat
c2 = fsolve (@quadrat,100)
Still very new to Matlab, so it may be a very basic error. I can also give the whole problem if needed
Full error message: Error using feval
Attempt to execute SCRIPT quadrat as a function: C:\Users\mcange3\Documents\MATLAB\quadrat.m
Error in fsolve (line 219) fuser = feval(funfcn{3},x,varargin{:});
Error in quadrat (line 15)
c2 = fsolve (@quadrat,100)
Caused by: Failure in initial user-supplied objective function evaluation. FSOLVE cannot continue.

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Quadratic Programming and Cone Programming 的更多信息

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by