Help with plotting an information grid

조회 수: 7 (최근 30일)
Sushmit
Sushmit 2014년 4월 14일
답변: Andrew Newell 2014년 4월 14일
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일
You should be able to do it with pcolor.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 2-D and 3-D Plots에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by