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

Antworten (1)

James Tursa
James Tursa am 17 Mär. 2018

0 Stimmen

Did you mean:
result = 1 + e;

Diese Frage ist geschlossen.

Gefragt:

am 17 Mär. 2018

Geschlossen:

am 20 Aug. 2021

Community Treasure Hunt

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

Start Hunting!

Translated by