How can I replace string categories into numbers (such as 'AAA' would become 1, 'AA+' would become 2)?
Show older comments
I found how to create a categorical array from integers but I'm trying to do the opposite as I want to calculate with the ratings.
3 Comments
Azzi Abdelmalek
on 27 Jan 2016
Can you post an example?
Peter Perkins
on 28 Jan 2016
Edited: Peter Perkins
on 28 Jan 2016
Although Sean has answered your specific question, needing to convert a categorical to numbers is sometimes an indication that maybe you are trying to do something that could be done another way, or something that categorical isn't really intended for. Can you provide more context?
Jelle Zwart
on 3 Feb 2016
Accepted Answer
More Answers (0)
Categories
Find more on Data Type Conversion 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!