Counting the amount of overlap for 2D surfaces

1 回表示 (過去 30 日間)
Barnabas Kovacs
Barnabas Kovacs 2021 年 3 月 2 日
コメント済み: Barnabas Kovacs 2021 年 3 月 2 日
I have a number of 2D matrices with the same sizes (180x20). They all have NaN values, and ones in certain areas. I would like to create a 3D histogram-like plot that counts the amount of overlap in certain locations, ie where the ones appear the most often. Can this be done with one of the histogram functions, or should I try using for example surf, with a custom color palette?
  1 件のコメント
Barnabas Kovacs
Barnabas Kovacs 2021 年 3 月 2 日
Nevermind actually, I realized I can just add them together, and plot the new surface :D

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

回答 (1 件)

KALYAN ACHARJYA
KALYAN ACHARJYA 2021 年 3 月 2 日
This way:
a=1:20;
b=1:180;
[x,y]=meshgrid(a,b);
data=randi(100,[180,20,20]);
tiledlayout(5,4);% 20 Plots
for i=1:20
nexttile,surf(x,y,data(:,:,i));
end
It is quite difficult to observe the overlap (based on observation) between surfaces by eye directly. Have you looked for a mathematical model? Like find the difference between each surface or the euclidian distance or any correlation between them (2D array case)

カテゴリ

Help Center および File ExchangeSurface and Mesh Plots についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by