How can I surface plot a 1000x2 matrix?

If we assume I have a 1000x2 matrix generated using:
A = randn(1000,2);
How can I surface plot that A matrix to achieve a result similar to this image:

 採用された回答

KSSV
KSSV 2021 年 2 月 26 日
編集済み: KSSV 2021 年 2 月 26 日

0 投票

A = randn(1000,2);
hist(A(:))
hist(A)

4 件のコメント

Gri Sch
Gri Sch 2021 年 2 月 26 日
Is it possible to 3D surface plot the 1000x2 matrix similar to the example image I gave in my initial post? I'm looking to use the surf or mesh commands.
KSSV
KSSV 2021 年 2 月 26 日
A = randn(1000,2);
hist3(A)
Gri Sch
Gri Sch 2021 年 2 月 26 日
Is hist3 my only option? There isn't a way for me to match the exact layout of the example image I gave? I'm sure the example I gave used surf to plot its data.
KSSV
KSSV 2021 年 2 月 26 日
編集済み: KSSV 2021 年 2 月 26 日
A = randn(1000,2) ;
x = A(:,1) ; y = A(:,2) ;
x0 = min(x) ; x1 = max(x) ;
y0 = min(y) ; y1 = max(y) ;
m = 10; n = 10 ;
x = linspace(x0,x1,m) ;
y = linspace(y0,y1,n) ;
Z = hist3(A,'Nbins',[m n]) ;
surf(x,y,Z)

サインインしてコメントする。

その他の回答 (1 件)

Steven Lord
Steven Lord 2021 年 2 月 26 日

0 投票

What does the data represent? X and Y coordinates of the points? If so where's the Z data?
Or do you have a long, thin sheet of paper and the data represents the height of points around the edges of that sheet?
x = [1 2 4 8; 0 3 3 9];
surf(x)

カテゴリ

製品

タグ

質問済み:

2021 年 2 月 26 日

回答済み:

2021 年 2 月 26 日

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by