Creating a heatmap of area from two equal matrices

1 次查看(过去 30 天)
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.

回答(1 个)

Muskan
Muskan 2023-2-20
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.

类别

Help CenterFile Exchange 中查找有关 Data Distribution Plots 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by