2015-05-09 82 views
3

我在3d(x,y,z)中有很多點,並且對於每個點我都有不同(0-10值),不同的點可以具有相同的視差。在matlab中可視化3D數據量

我想繪製這個數據,每個點根據它的差異會有一個顏色。

我希望它是這樣的畫面:(小的差距將有一個顏色,因爲它變得更大的顏色變化)

enter image description here

我該怎麼辦呢?

+0

雖然上述地塊是不是你的目的之一,我仍然認爲這是真的很酷。 – rayryeng

回答

4

使用scatter3

x = rand(1,1000); 
y = rand(1,1000); 
z = rand(1,1000); %// example x, y, z 
d = x.^2+y.^2+z.^2; %// example disparity 
scatter3(x,y,z,8,d,'fill'); 
colorbar 

第四輸入參數scatter3是標記大小。第五個決定顏色。 'fill'使用填充標記。

enter image description here