Need help starting this code!!! Arrays

1 次查看(过去 30 天)
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.

回答(1 个)

madhan ravi
madhan ravi 2020-11-14

类别

Help CenterFile Exchange 中查找有关 Loops and Conditional Statements 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by