how can i get function of sinh in taylor series

12 views (last 30 days)
clc;
clear;
close all;
n = input('Please give order number in the taylor series: ');
x = input('Please give a value for "x": ');
approxValue = 0;
% Initial value of approxValue.
for k = 0:n
approxValue = (approxValue + ((x.^((2*n)+1))/factorial((2*n)+1)));
% Gives the approx value of e^x as a taylor series
end
disp('approxValue =')
disp((approxValue))
disp('sinh(x)=')
disp(sinh(x))

Answers (1)

Thorsten
Thorsten on 4 Dec 2015
The loop runs over k, but you use n in the formula.

Tags

No tags entered yet.

Community Treasure Hunt

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

Start Hunting!