how to implement the algorithm for approximating Cosine using the Taylor series

조회 수: 1 (최근 30일)
The Taylor Series approximation for Cosine with varying values of n from n=0 to n=4 is given. and i have to use two arguments, theta and n where theta is angle in radians and n is the number of terms.
  댓글 수: 4
madhan ravi
madhan ravi 2020년 8월 10일
Next time please post what you have tried. Please don’t expect others to write your homework.
Rik
Rik 2020년 8월 10일
turns out it did not work before because I was using an alternative for Matlab. I would like to remove it
The mere fact you were using Octave doens't make this question not appropriate for Matlab Answer. I would even suggest it is more relevant here if it doesn't work on Octave. In case you think of removing your question and/or change your username to avoid detection of cheating on your homework: don't bother. I have made a copy below, and site admin are generally able to restore such edits.
how to implement the algorithm for approximating Cosine using the Taylor series
The Taylor Series approximation for Cosine with varying values of n from n=0 to n=4 is given. and i have to use two arguments, theta and n where theta is angle in radians and n is the number of terms.

댓글을 달려면 로그인하십시오.

채택된 답변

Vladimir Sovkov
Vladimir Sovkov 2020년 8월 10일
syms theta
n=4;
taylor(cos(theta),'Order',n)

추가 답변 (0개)

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by