how to add headers to a matrix?
1 次查看(过去 30 天)
显示 更早的评论
i have a matrix 10x10 of zeros under the name play_space......and i would like to name the rows A-J and columns 1-10,so the when i want to change some values in the matrix i will have to type in eg: play_space(B,3).
could someone please help?
0 个评论
采纳的回答
Azzi Abdelmalek
2013-12-1
Why to use letters instead numbers?
A=rand(10)
A(2,3) % is simpler then using letters
3 个评论
Azzi Abdelmalek
2013-12-1
If you want to work with letters
A=rand(10)
h='A':'J'
A1=@(s,j) A(strfind(h,s),j)
A1('B',3)
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Matrix Indexing 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!