How to name each row and column of a Matrix

조회 수: 7 (최근 30일)
Marimuthu Ananthavelu
Marimuthu Ananthavelu 2018년 1월 28일
댓글: Star Strider 2018년 1월 28일
I had constructed a Matrix for which I wish to assign a row name and column name. Is there any way to achieve this in an easy way?. This I will further use to plot the Color map (pcolor) indicating the names. Thanks.

답변 (1개)

Star Strider
Star Strider 2018년 1월 28일
The only way I can think of to do this is to use a table (link). See the links at the end of that page for more information on using the,.
  댓글 수: 2
Marimuthu Ananthavelu
Marimuthu Ananthavelu 2018년 1월 28일
Hi Thanks. But pcolor() does not accept the table. It should be a Matrix.
Star Strider
Star Strider 2018년 1월 28일
My pleasure.
These seem to be two separate problems. Use your matrix for both.
Create your table and use it to do whatever calculations you want to with it.
Create your pcolor (or image) object separately. It is easy enough to label the row and column tick labels with whatever you want, and you can use the same cell arrays of names or titles for both (providing that they are valid MATLAB variable names, since table requires that).
I would use image rather than pcolor.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Matrix Indexing에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by