Error using Taylor with order n as variable
4 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Qingyang Zhang
le 11 Oct 2019
Modifié(e) : Sulaymon Eshkabilov
le 11 Oct 2019
I want to find several taylor polynomials with n = 1:10
I have the following code:
syms x;
syms n positive integer;
f(x) = atan(x);
P(x,n) = taylor(f, x, 'Order', n);
But there is a Error:
Error using sym/taylor (line 99)
The value of 'Order' is invalid. It must satisfy the function: isPositiveInteger.
0 commentaires
Réponse acceptée
Sulaymon Eshkabilov
le 11 Oct 2019
Modifié(e) : Sulaymon Eshkabilov
le 11 Oct 2019
Hi,
Here is the complete answer to your exercise:
syms x
f(x) = atan(x);
syms ii positive integer;
for ii=1:10
P(ii) = taylor(f, x, 'Order', ii);
end
Good luck.
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!