MATLAB爱好者论坛-LabFans.com

MATLAB爱好者论坛-LabFans.com (https://www.labfans.com/bbs/index.php)
-   MATLAB论坛 (https://www.labfans.com/bbs/forumdisplay.php?f=6)
-   -   [MATLAB GUI] 求助!关于plot (https://www.labfans.com/bbs/showthread.php?t=9315)

oushiquan 2009-07-26 15:25

求助!关于plot
 
很简单,我只是想画一条水平线[0,50],[115,50]
命令:
clear;clc;
axis([0, 100, 0, 100])
plot([0,50],[115,50])

但画出得是斜线,然后我把115改成50,即plot([0,50],[50,50])它显示得是水平线。
感觉很奇怪~~~
各位知道是什么原因吗,谢谢!

Gaietyoaf 2009-07-26 18:36

回复: 求助!关于plot
 
原因很简单呀,仔细看plot命令格式就解决了。plot(x,y);x,y分别为坐标数组。输入应是plot([0,115],[50,50]).

oushiquan 2009-07-27 14:57

回复: 求助!关于plot
 
明白了,谢谢你!问题得到解决。


所有时间均为北京时间。现在的时间是 08:28

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