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

8 ビュー (過去 30 日間)
John
John 2014 年 10 月 18 日
回答済み: Star Strider 2014 年 10 月 19 日
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.

回答 (1 件)

Star Strider
Star Strider 2014 年 10 月 19 日
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])

カテゴリ

Help Center および File ExchangeAxes Appearance についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by