Help with plotting an information grid

7 vues (au cours des 30 derniers jours)
Sushmit
Sushmit le 14 Avr 2014
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?

Réponse acceptée

Andrew Newell
Andrew Newell le 14 Avr 2014
You should be able to do it with pcolor.

Plus de réponses (0)

Catégories

En savoir plus sur 2-D and 3-D Plots dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by