Help with plotting an information grid

I have a n x n matrix, all of whose elements are either 0,1,2,3 or 4. Now I want to represent this matrix in the form of a n x n grid such that each block(cell) of the grid is colored according to the corresponding element in the matrix(say 0- white, 1 -red, 2- blue and so on). How do I do this?

 採用された回答

Andrew Newell
Andrew Newell 2014 年 4 月 14 日

0 投票

You should be able to do it with pcolor.

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File Exchange2-D and 3-D Plots についてさらに検索

タグ

質問済み:

2014 年 4 月 14 日

回答済み:

2014 年 4 月 14 日

Community Treasure Hunt

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

Start Hunting!

Translated by