function file for maclauring series approximation
3 次查看(过去 30 天)
显示 更早的评论
My function file: function [approx] =cos1(x,n) %Calculates the Malcurin series approximation to cos(x) approx=0; for i=0:n-1 approx=approx+(1)^i*x^(2*i)/factorial(2*i) end
My command window: approx1=cos1(pi/3,1)
approx =
1
approx1 =
1
(How come i generated the value of one term , it comes up two variable with same value? How to minimize it to one variable?)
0 个评论
采纳的回答
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Genomics and Next Generation Sequencing 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!