Need help in Taylor Series
4 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
João Carvalho
le 21 Oct 2017
Commenté : João Carvalho
le 22 Oct 2017

How can I ask the user for a term N to calculate the Taylor Serie (image) and then to ask if he wnats the sinh x or cosh x? Thanks
0 commentaires
Réponse acceptée
Birdman
le 21 Oct 2017
deg=input('Enter the degree\n');
funcType=input('Enter 1 for sinhx, 2 for coshx\n');
syms x m
f=x^m/factorial(m);
if(funcType==1)
for n=1:2:deg
f(n)=x^n/factorial(n);
end
end
if(funcType==2)
f(1)=1;
for n=2:2:deg
f(n)=x^n/factorial(n);
end
end
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Calculus dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!