Help with basics and finite difference method
조회 수: 3 (최근 30일)
이전 댓글 표시
I have to write a program using the finite-difference formula to calculate the approximate value for the derivative of a function. The test will be tan(x) for x=1, determining the error by comparing with sec^2(x). I have no idea where to begin.
댓글 수: 0
채택된 답변
Image Analyst
2014년 9월 14일
How about a for loop and taking the delta Y over the delta X where the separation is decreasing until it gets really really small, then compare to sec^2(x) and see how the difference gets smaller and smaller as the separation gets smaller and smaller. That's the finite difference method.
댓글 수: 7
Image Analyst
2014년 9월 15일
OK, great, glad I could help. Can you go ahead and mark the answer as Accepted then?
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Graphics Performance에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!