Forward, backward and central differences

trying to calculate the forward, backward and central difference for tanx+cosy with a step of 0.1 and x and y domains between 1 and 5.

3 件のコメント

madhan ravi
madhan ravi 2018 年 10 月 21 日
What have you tried so far?
Image Analyst
Image Analyst 2018 年 10 月 21 日
What is your definition of those 3 differences?
HoboHarry
HoboHarry 2018 年 10 月 21 日
i'm not even sure where to start. i know for just calculating one for tanx by itself uses (f(x+h)-f(x))/h; for fwd difference where h is the step. but not sure where to go with two variables

サインインしてコメントする。

回答 (1 件)

Image Analyst
Image Analyst 2018 年 10 月 21 日

0 投票

Try conv():
kernel = [1, -1];
output = conv(signal, kernel);
kernel = [-1, 1];
output = conv(signal, kernel);
kernel = [1, -2, 1];
output = conv(signal, kernel);
See if that gives you what you want. Do you have a signal and the desired output so we can check it?

質問済み:

2018 年 10 月 21 日

回答済み:

2018 年 10 月 21 日

Community Treasure Hunt

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

Start Hunting!

Translated by