Need help starting this code!!! Arrays

1 visualización (últimos 30 días)
Hudson Harrell
Hudson Harrell el 14 de Nov. de 2020
Respondida: madhan ravi el 14 de Nov. de 2020
I have 2 array for example x=[0 1 2 3 4 5 6 7 8 9 10] and f=[10 11 12 13 14 15 16 17 18 19 20] that are given, that I need to plug into the formula for foward, backward, and central differencing. The formula for Forward differencing is f'(xi)=(f(xi+1)-f(xi))/h, Backward f'(xi)=(f(xi)-f(xi-1))/h, and central f'(xi)=(f(xi+1)-f(xi-1))/2h, and the step size is h=1, 2. I was thinking of approaching this using a loop but i'm really unsure where to start. I get really lost when trying to create any type of loops hence why I don't have any code to provide to start with. Any advice would be great and helpful.

Respuestas (1)

madhan ravi
madhan ravi el 14 de Nov. de 2020

Categorías

Más información sobre Loops and Conditional Statements en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by