How can I make exponential function visible

I'm trying plot Y = exp(-10^18* X)
But since there is -10^18 inside the exponential, my graph seems really weird.
What is the best way( maybe the best x-axis, y-axis scale) to make this graph better looking?

1 件のコメント

Torsten
Torsten 2022 年 4 月 3 日
Plot for X values in between 0 and 10^(-18).

サインインしてコメントする。

回答 (1 件)

Star Strider
Star Strider 2022 年 4 月 3 日

0 投票

One option would be to create at lelast the y-axis scale as logarithmic —
X = linspace(0, 1, 50);
Y = exp(-10^18* X);
figure
plot(X, Y)
grid
title('Linear Scale')
X = logspace(-18, 0, 50);
Y = exp(-10^18* X);
figure
semilogy(X, Y)
grid
title('Logarithmic Y-Axis Scale')
.

カテゴリ

ヘルプ センター および File Exchange2-D and 3-D Plots についてさらに検索

質問済み:

2022 年 4 月 3 日

回答済み:

2022 年 4 月 3 日

Community Treasure Hunt

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

Start Hunting!

Translated by