필터 지우기
필터 지우기

Forward, backward and central differences

조회 수: 1 (최근 30일)
HoboHarry
HoboHarry 2018년 10월 21일
답변: Image Analyst 2018년 10월 21일
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
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일
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?

카테고리

Help CenterFile Exchange에서 Functional Programming에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by