Why will matlab plot one tan function but not the other.

8 vues (au cours des 30 derniers jours)
John
John le 18 Oct 2014
Why will matlab plot tan(8856*x/9444) using ezplot but won't plot 'tan(8856906554427779*x/9444732965739290427392).
For the first one it gives me a nice tangent looking graph but for the second one I just get a diagonal line.

Réponses (1)

Star Strider
Star Strider le 19 Oct 2014
They’re not the same functions. The fraction in ‘f1’ =0.9377 (q1). The fraction in ‘f2’ =937.8E-009 (q2). Enlarging the x-axis limits as in figure(2) produces the desired plot:
f1 = @(x) tan(8856*x/9444);
q1 = 8856/9444;
f2 = @(x) tan(8856906554427779*x/9444732965739290427392);
q2 = 8856906554427779/9444732965739290427392;
figure(1)
ezplot(f1)
figure(2)
ezplot(f2, [-2E+6*pi 2E+6*pi])

Catégories

En savoir plus sur Axes Appearance dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by