Need help starting this code!!! Arrays

1 Ansicht (letzte 30 Tage)
Hudson Harrell
Hudson Harrell am 14 Nov. 2020
Beantwortet: madhan ravi am 14 Nov. 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.

Antworten (1)

madhan ravi
madhan ravi am 14 Nov. 2020

Kategorien

Mehr zu Loops and Conditional Statements finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by