Creating a heatmap of area from two equal matrices
2 次查看(过去 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.
0 个评论
回答(1 个)
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.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Data Distribution Plots 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!