S= [2 3 4 1;3 1 8 2;1 4 1 2;5 3 2 9;3 1 1 4;7 6 3 5;4 5 6 2];
printmat(S,'','A11 A12 A21 A22 A23 A31 A32','M1 M2 M3 M4')
Above code i used to generate the names of rows and columns shown below. Now I want to access the elements of matrix 'S' with my given row and column names. Example (A12, M3) =8. To this output I need the code. Thanks in advance
ans:
M1 M2 M3 M4 A11 2.00000 3.00000 4.00000 1.00000 A12 3.00000 1.00000 8.00000 2.00000 A21 1.00000 4.00000 1.00000 2.00000 A22 5.00000 3.00000 2.00000 9.00000 A23 3.00000 1.00000 1.00000 4.00000 A31 7.00000 6.00000 3.00000 5.00000 A32 4.00000 5.00000 6.00000 2.00000
Best Answer