2015-02-10 75 views

回答

1

說你的m * n個矩陣爲A

你可以通過調用

figure %# opens a new figure, otherwise you'll overwrite an existing one 
surf(A) 

如果你想添加x和y指數繪製數據作爲surface

surf(xIndices, yIndices, A) 

如果你想要一個散點圖,你需要創建與A相同尺寸的數組,首先爲座標

[xx,yy] = meshgrid(xIndices, yIndices); 
plot3(xx(:), yy(:), A(:), 'o'); 

or 

scatter3(xx(:), yy(:), A(:)) 
+1

或[mesh()](http://uk.mathworks.com/help/matlab/ref/mesh.html)..我認爲這將涵蓋所有選項... – kkuilla 2015-02-10 09:38:14