Clear Filters
Clear Filters

How to plot matrix to color band

3 views (last 30 days)
Mad Gano
Mad Gano on 26 Jul 2022
Commented: Mad Gano on 26 Jul 2022
I have such a matrix
X=[1, 2, 1, 3, 2, 1, 4, 2, 1, 3 ;...
2, 1, 1, 3, 6, 2, 4, 3, 2, 1;...
4, 1, 7, 2, 4, 3, 2, 4, 1, 2;...
2, 1, 5, 7, 5, 6, 7, 1, 2, 3];
And I want to plot it like this
ofcourse with axis and colorbar
It is posible to do that?

Accepted Answer

Abderrahim. B
Abderrahim. B on 26 Jul 2022
Edited: Abderrahim. B on 26 Jul 2022
X=[1, 2, 1, 3, 2, 1, 4, 2, 1, 3 ;...
2, 1, 1, 3, 6, 2, 4, 3, 2, 1;...
4, 1, 7, 2, 4, 3, 2, 4, 1, 2;...
2, 1, 5, 7, 5, 6, 7, 1, 2, 3];
heatmap(X, 'CellLabelColor', 'none')
colormap(flipud(gray))
colorbar

More Answers (0)

Community Treasure Hunt

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

Start Hunting!