Matrix with numeric values
1 次查看(过去 30 天)
显示 更早的评论
I have assigned letters A through Z a numeric value of 1 through 26, respectively. I have been able to form a 26x19 matrix with these random numeric values. However, I do not know how to convert the entire matrix back to character form.
For example, if part of my matrix is [1 2 3 4], I want it to be [A B C D]. (Note: as said above, I have assigned variable A to equal 1, variable B to equal 2, etc.)
1 个评论
Stephen23
2020-4-7
"I have assigned letters A through Z a numeric value of 1 through 26..."
Sounds like a complex approach.
A much simpler use of MATLAB ("MATrix LABoratory") would be to use vectors/matrices to store your data.
采纳的回答
Birdman
2020-4-7
编辑:Birdman
2020-4-7
N=4
A=1:N;
B=char(64+A)
'ABCD'
B(1)
'A'
B(2)
'B'
.
.
and so on. Change N and observe the results.
更多回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!