Need help starting this code!!! Arrays

1 visualizzazione (ultimi 30 giorni)
Hudson Harrell
Hudson Harrell il 14 Nov 2020
Risposto: madhan ravi il 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.

Risposte (1)

madhan ravi
madhan ravi il 14 Nov 2020

Categorie

Scopri di più su Loops and Conditional Statements in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by