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?

 채택된 답변

Azzi Abdelmalek
Azzi Abdelmalek 2013년 12월 1일

0 개 추천

Why to use letters instead numbers?
A=rand(10)
A(2,3) % is simpler then using letters

댓글 수: 3

Azzi Abdelmalek
Azzi Abdelmalek 2013년 12월 1일
Roshan varkey commented
i know,but i need the alphabets for the project i am doing. i am able to to do it with numbers but using alphabets is tough and thats what i have been asked to use for the project,i have no choice and i am not able to figure it out.
Azzi Abdelmalek
Azzi Abdelmalek 2013년 12월 1일
편집: Azzi Abdelmalek 2013년 12월 1일
X=rand(10)
A=1;
B=2;
C=3;
% and so on
X(A,3)
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개)

카테고리

도움말 센터File Exchange에서 Matrix Indexing에 대해 자세히 알아보기

질문:

2013년 12월 1일

댓글:

2013년 12월 1일

Community Treasure Hunt

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

Start Hunting!

Translated by