Counting the amount of overlap for 2D surfaces

1 Ansicht (letzte 30 Tage)
Barnabas Kovacs
Barnabas Kovacs am 2 Mär. 2021
Kommentiert: Barnabas Kovacs am 2 Mär. 2021
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 Kommentar
Barnabas Kovacs
Barnabas Kovacs am 2 Mär. 2021
Nevermind actually, I realized I can just add them together, and plot the new surface :D

Melden Sie sich an, um zu kommentieren.

Antworten (1)

KALYAN ACHARJYA
KALYAN ACHARJYA am 2 Mär. 2021
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)

Community Treasure Hunt

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

Start Hunting!

Translated by