歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
您现在的位置: Linux教程網 >> UnixLinux >  >> Linux編程 >> Linux編程

Matlab中三維散點圖的繪制

示例1:
clc; close all; clear all;
[x,y,z] = sphere(16);
X = [x(:)*.5 x(:)*.75 x(:)];
Y = [y(:)*.5 y(:)*.75 y(:)];
Z = [z(:)*.5 z(:)*.75 z(:)];
S = repmat([1 .75 .5]*10,prod(size(x)),1);
C = repmat([1 2 3],prod(size(x)),1);
figure;
scatter3(X(:),Y(:),Z(:),S(:),C(:),'filled');
view(-60,60); box on; title('scatter3實例');

示例2:

x=[4229042.63      4230585.02    4231384.96    4231773.63    4233028.58    4233296.71    4235869.68    4236288.29];
y=[431695.4   441585.8      432745.6 436933.7      428734.4       431946.3 428705.0      432999.5];
z=[1.019 1.023      1.011      1.022      1.020      1.022      1.022      1.023];
scatter3(x,y,z)
注:x,y,z是三個等長的矢量

Copyright © Linux教程網 All Rights Reserved