Effacer les filtres
Effacer les filtres

Creating a heatmap of area from two equal matrices

3 vues (au cours des 30 derniers jours)
Charlie Milford
Charlie Milford le 7 Sep 2022
Réponse apportée : Muskan le 20 Fév 2023
I have two equal matrices which represent values of 'phase' and 'speed' where each value represents an equal area of a grid.
How would I create a heatmap to show (%) of total area with one matrix on the x and one matrix on the y?
Thanks.

Réponses (1)

Muskan
Muskan le 20 Fév 2023
As per my understanding, we can follow the following steps:
1) Each matrix’s values should be normalised so that they fall between 0 and 1. We can use “mat2gray()” function for this.
2) The “hist3()” function can be used to produce a 2D histogram from the two matrices. A bivariate histogram is produced by this function with a predetermined number of bins in each dimension.
3)Convert the counts in the histogram to percentages of the entire area.
4) Use the “imagesc()” function to create a heatmap of the percentage of data.

Catégories

En savoir plus sur Data Distribution Plots dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by