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