How can I make exponential function visible

조회 수: 1 (최근 30일)
Aliena
Aliena 2022년 4월 3일
답변: Star Strider 2022년 4월 3일
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일
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')
.

카테고리

Help CenterFile Exchange에서 2-D and 3-D Plots에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by