MATLAB爱好者论坛-LabFans.com

MATLAB爱好者论坛-LabFans.com (https://www.labfans.com/bbs/index.php)
-   MATLAB论坛 (https://www.labfans.com/bbs/forumdisplay.php?f=6)
-   -   [MATLAB基础] 如何把图上的点连接起来? (https://www.labfans.com/bbs/showthread.php?t=9705)

makeupfor 2009-09-18 19:08

如何把图上的点连接起来?
 
比如有三个点A(1,0)B(2,1)C(3,0)

可以用下面的代码画出点来。

x=[1 2 3]
y=[0 1 0]
plot(x,y,'r.')

可是我想将AB,AC,BC连接起来画一个三角形应该怎么做呢?

:)

zhyqcharlie 2009-09-18 19:21

回复: 如何把图上的点连接起来?
 
x=[1 2 3]
y=[0 1 0]
plot(x,y,'r.')

hold on;
a=[1 3];
b=[0 0];
plot(a,b,'r');

试试看哦!


所有时间均为北京时间。现在的时间是 06:14

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