value in each iteration
2 次查看(过去 30 天)
显示 更早的评论
f=@(x) 0.5*(x(1)-1).^2+10*(x(2)+2).^2-2
miter=10000
and i have loop
for i=1:miter
then,who i can to calculate f(i)-f(i-1)?
6 个评论
Walter Roberson
2020-9-19
You cannot. Your gradient descent formula is only valid for functions of one variable.
回答(1 个)
saja mk
2020-9-19
1 个评论
Walter Roberson
2020-9-19
this does not use the epsilon formula from https://www.mathworks.com/matlabcentral/answers/596404-value-in-each-iteration#comment_1015369
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Loops and Conditional Statements 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!