how can we sketch the graph of this iteration xn+1=xn-8*f'(xn) in matlab code?

3 visualizaciones (últimos 30 días)
f(x)=x^2;
x0=0.5;
tolerance =0.0001
xn+1=xn-8*f'(xn)
  1 comentario
John D'Errico
John D'Errico el 4 de Mayo de 2023
Will you post every homework assignment you get? Please don't. Please start to do your own homework.

Iniciar sesión para comentar.

Respuestas (2)

Cris LaPierre
Cris LaPierre el 4 de Mayo de 2023
Have you tried the plot command?
See Ch 9 of MATLAB Onramp.

Walter Roberson
Walter Roberson el 4 de Mayo de 2023
consider
f(x)=x^2;
x(n+1) = x(n) -8*f'(x(n))
But when f(x) = x^2 then f'(x) = 2*x so x(n+1) = x(n) - 8*2*x(n) = -15*x(n)
and so X(N) = (-15)^N * X0^N
When X0 > 1/15 then X0^N does not shrink faster than the 15^N grows so this equation is divergent for X0 as large as 1/2 and will be approximately (-8)^N

Categorías

Más información sobre Programming en Help Center y File Exchange.

Etiquetas

Productos

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by