Using values in an array to represent characters?
Show older comments
I have a vector x= [1:1:12]. Each value, from 1 to 12, should represent the corresponding months January to December. 1 is equal to January, 2 is equal to February, and so on. How would I do this, if possible? Also, if I were to create a new vector by selecting values from vector x, how would I display only the corresponding months. For example, my vector is M = [1 2 4 5 6] and I want it to display the months that correspond with those values.
Accepted Answer
More Answers (0)
Categories
Find more on Operators and Elementary Operations in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!