MATLAB爱好者论坛-LabFans.com

MATLAB爱好者论坛-LabFans.com (https://www.labfans.com/bbs/index.php)
-   资料存档 (https://www.labfans.com/bbs/forumdisplay.php?f=72)
-   -   如何在Matlab中绘制对数图 (https://www.labfans.com/bbs/showthread.php?t=23775)

poster 2019-12-10 20:48

如何在Matlab中绘制对数图
 
是否可以在matlab中绘制实际上不使用值的对数的图?我正在绘制各种值,当我尝试对它们进行对数绘制时,小于1的值将变为负数。我只想在不取其日志的情况下以对数刻度绘制值。



[B]回答:[/B]

对的,这是可能的。使用[URL="http://www.mathworks.com/access/helpdesk/help/techdoc/ref/loglog.html"]loglog命令[/URL] 。

Mathworks网站上的示例:

x = logspace(-1,2); % generate a sequence of points equally spaced logarithmically loglog(x,exp(x),'-s') grid on [URL="https://i.stack.imgur.com/Qft5u.png"][IMG]https://i.stack.imgur.com/Qft5u.png[/IMG][/URL]

如果您不希望两个轴都是对数刻度,请使用[URL="http://www.mathworks.com/access/helpdesk/help/techdoc/ref/semilogx.html"]semilogx或semilogy[/URL] 。



[url=https://stackoverflow.com/questions/3454513]更多&回答...[/url]


所有时间均为北京时间。现在的时间是 01:04

Powered by vBulletin
版权所有 ©2000 - 2025,Jelsoft Enterprises Ltd.