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 CenterFile Exchange에서 Surface and Mesh Plots에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by