how to change this program code of sinh in taylor series to tanh..as i know for tanh include of bernoulli number..thank you

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

Answers (0)

Tags

No tags entered yet.

Community Treasure Hunt

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

Start Hunting!