MATLAB爱好者论坛-LabFans.com

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

kidylonglong 2009-02-17 08:12

[求助]关于plot的问题
 
我是初学者,想请问plot的问题。
比如y=2x,x=2,3,4.
请问怎么用命令把横坐标为 2 3 4 纵坐标为4 6 8的点显示出来而不是显示一条直线。
引申一下,,如果 刚才x为矩阵,
请问怎么用命令把横坐标为 矩阵组数,纵坐标为y值的点显示出来。
非常感谢

thorne 2009-02-19 09:28

回复: [求助]关于plot的问题
 
question 1:
如下代码(关键是plot中的'o'选项)
x=[2 3 4];
y=2*x;
plot(x,y,'o');
question 2:
用mesh 命令即可
如 >>A=magic(10);
>>mesh(A);


所有时间均为北京时间。现在的时间是 11:13

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