MATLAB爱好者论坛-LabFans.com

MATLAB爱好者论坛-LabFans.com (https://www.labfans.com/bbs/index.php)
-   资料存档 (https://www.labfans.com/bbs/forumdisplay.php?f=72)
-   -   绘制3D并在Matlab中合并 (https://www.labfans.com/bbs/showthread.php?t=26378)

poster 2019-12-14 20:13

绘制3D并在Matlab中合并
 
我有这个矩阵"experiment=2*rand(npoints,3)-1" 。我想以3D绘图,所以我使用"mesh(experiment)" 。我该如何在情节中取得红点?

另外,我想在上面的图中实现一个半径为0,0,0的球体。我做了:

mesh(experiment) hold on [x,y,z]=sphere; r=1; mesh(r*x,r*y,r*z) hold off 但是1)我没有采用半径1 2)这些数字只是在同一张图中显示,但没有合并

谢谢



[B]回答:[/B]

使用scatter3绘制点

scatter3(experiment(:,1), experiment(:,2), experiment(:,3), '.r'); 直通网

mesh(r*x,r*y,r*z, 'FaceColor','none', 'EdgeColor','b') 或半透明的网格

mesh(r*x,r*y,r*z, 'FaceColor','w', 'EdgeColor','b') alpha(0.5)

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


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

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