Challenge

Week 3.5 - Deriving 4th order approximation of a 2nd order derivative using Taylor Table method

clear all
close all
clc

% number of terms in taylor series

n=38;
n_x=10
x=linspace(0,05,n_x);

%for each value of x
for j=1:n_x
%for each term in taylor series
for i=1:n
term(i)=x(j)^(i-1)/factorial(i-1);
end
taylor_series_approximation(j)=sum(term);
end
figure(1)
plot(x,exp(x),'Color','r')
hold on
plot(x,taylor_series_approximation,'*','Color','b')

xlabel('x axis')
ylabel('exp(x)')
legend('exact expresion','taylor series approx')

Your portfolio, next

Ship work like this
in your own course.

Talk to a career counsellor

Free 20-minute call. We'll map the right course to where you want to work.

By submitting you agree to our Terms and Privacy Policy.

Talk to a career counsellor

Free 20-minute call. We'll map the right course to where you want to work.

By submitting you agree to our Terms and Privacy Policy.