1. 程式人生 > >MATLAB三維散點圖的繪製(scatter3、plot3)

MATLAB三維散點圖的繪製(scatter3、plot3)

(1函式scatter3

用法:scatter3(x,y,z,'.',c) % c 為顏色,需和x,y,z長度相同

例子:

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必須是等長度的數對(即三個等長的向量)

(2)函式plot3

用法:plot3(x,y,z,'b.','MarkerSize',0.5)    % MarkerSize 表示點的大小,b.表示綠色的點。