value in each iteration
Mostrar comentarios más antiguos
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 comentarios
Mario Malic
el 19 de Sept. de 2020
What is the purpose of this question on which you got the answer?
saja mk
el 19 de Sept. de 2020
Walter Roberson
el 19 de Sept. de 2020
That f needs a vector of length 2 for its parameter, not a scalar i.
saja mk
el 19 de Sept. de 2020
saja mk
el 19 de Sept. de 2020
Walter Roberson
el 19 de Sept. de 2020
You cannot. Your gradient descent formula is only valid for functions of one variable.
Respuestas (1)
saja mk
el 19 de Sept. de 2020
0 votos
1 comentario
Walter Roberson
el 19 de Sept. de 2020
this does not use the epsilon formula from https://www.mathworks.com/matlabcentral/answers/596404-value-in-each-iteration#comment_1015369
Categorías
Más información sobre Loops and Conditional Statements en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!