getting error Error in fminbnd (line 312) if fu <= fx
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
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 comentarios
Respuestas (1)
Walter Roberson
el 26 de Mzo. de 2021
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.
Ver también
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!