Conversion of Categorical to double
Show older comments
Hello everyone'
I have a table with values created with a categorization that I do not know. I would like to convert these into double array for normal manipulation. However, the following code gives me a categorical array that cannot be manaipulated easily by normal operations.
y=table2array(Data(:,1));
Converting it into a double, it yield values that are not the same as what is contained in the table.
y1=grp2idx(y);
Can someone please explain what the vector y1 represents and how I can use that to get the double array that is not categorical.
thanks.
Accepted Answer
More Answers (1)
dpb
on 1 May 2019
To answer the question posed,
Data.Column7=double(Data.Column7);
but see the comment above -- the better solution would be to fix the problem at the point it was created instead of cleaning up a mess later.
1 Comment
Categories
Find more on Categorical Arrays 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!