What is the error in this code.

%expansion of maclaurine series
function result = expansion(n,x)
c = [1];
d = [1:n];
a = [x.^d];
for i=1:n
vec = [vec,1./prod(1:i)];
end
e = sum(a.*vec);
result = [1+sum];
end

回答 (1 件)

James Tursa
James Tursa 2018 年 3 月 17 日

0 投票

Did you mean:
result = 1 + e;

この質問は閉じられています。

質問済み:

2018 年 3 月 17 日

閉鎖済み:

2021 年 8 月 20 日

Community Treasure Hunt

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

Start Hunting!

Translated by