MATLAB爱好者论坛-LabFans.com

MATLAB爱好者论坛-LabFans.com (https://www.labfans.com/bbs/index.php)
-   资料存档 (https://www.labfans.com/bbs/forumdisplay.php?f=72)
-   -   从点列表中绘制图 (https://www.labfans.com/bbs/showthread.php?t=22966)

poster 2019-12-10 16:49

从点列表中绘制图
 
我有几点

1 1 2 5 3 10 4 20 ... ... 如何在Matlab中的图形中绘制此图形?当我尝试在工作区中选择“ points”变量并在菜单中单击“ plot”时,它将第一列绘制为蓝色,第二列绘制为绿色。我相信它将两列视为不同的功能,而这不是我想要的。我的第一列应该是X,第二列应该是Y。

谢谢


回答:
p = rand(50, 2); %# 50 random points plot(p(:,1), p(:,2), 'r.') %# plot data as red points with 1st column %# as x-coordinate, and 2nd column as y-coordinate

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


所有时间均为北京时间。现在的时间是 02:09

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