How to plot matrix to color band

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

采纳的回答

Abderrahim. B
Abderrahim. B 2022-7-26
编辑:Abderrahim. B 2022-7-26
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

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Surface and Mesh Plots 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by