Having problems with my function code iterating an initial guess (optimization)
显示 更早的评论
Hello people,
Im having problems trying to iterate from an initial guess.
On my function file i got a function FRes
function R=FRes(guess,~,~,~,~,~)
R=(1./(Tk.^alpha-g))-((beta*alpha*g.^(alpha-1))./((g.^alpha)-gg));
Where my guess is included in the "g" and the "gg" variable.
So i created this code trying to optimize:
It=@(guess)FRes(guess,alpha,beta); (which i think says, on the FRes function the thing u gonna change is "guess".
Then I try doing fminsearch/fzero on (It,guess) on (FRes,guess) on (R,guess) but im not having any luck.
Thanks in advance for your time.
回答(1 个)
Alan Weiss
2012-5-7
Sorry, I do not understand what you are asking.
Perhaps you can include your entire function call, such as
x = fzero(fcn1,x0)
and also include the MATLAB output. Then perhaps I will understand.
Alan Weiss
MATLAB mathematical toolbox documentation
类别
在 帮助中心 和 File Exchange 中查找有关 Choose a Solver 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!