getting error Error in fminbnd (line 312) if fu <= fx
조회 수: 2 (최근 30일)
이전 댓글 표시
function[kcm,Recm]=oserecritmin(alp1,alp2,Re1,Re2,N)
[Recm,kcm]=fminbnd('@oserecrit',alp1,alp2,[],Re1,Re2,N);
end
function [Rec,kc] = oserecrit(alp,Re1,Re2,N)
Rec= fzero('@osefun1',[Re1;Re2],[],alp,N);
kc = alp ;
end
i m having these two functions and one more named osefun1. while running oserecritmin i getting this error for oserecritmin(0.95, 1.1, 6500, 7000, 100)
댓글 수: 0
답변 (1개)
Walter Roberson
2021년 3월 26일
You cannot use quoted functions with the @ syntax. Use @oserecrit an @osefun1
Also you appear to be trying to pass in extra parameters to the functions. That ability has been undocumented for over 15 years, and is known to fail in some circumstances. See
http://matlab.wikia.com/wiki/FAQ#How_can_I_share_data_between_callback_functions_in_my_GUI.28s.29.3F
Also, the function you pass to fminbnd() cannot have multiple outputs.
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!