How to convert categorical data to double with unique rows

2 vues (au cours des 30 derniers jours)
Deborah Johnson
Deborah Johnson le 19 Jan 2023
Commenté : Deborah Johnson le 19 Jan 2023
Hello, please assist me with converting categorical data to double data. Would a if statement do this?
Under Vertical Steering Column, replace unique categoriacal text to a unique double value.
rows with Altitude to '0'
rows with Limbo to '6'

Réponse acceptée

David Hill
David Hill le 19 Jan 2023
Modifié(e) : David Hill le 19 Jan 2023
a=readtable('Book1.xlsx');
b=zeros(size(a));
b(ismember(a.Vertical_Steering,'Limbo'))=6
b = 1045×1
0 0 0 0 0 0 0 0 0 0
  1 commentaire
Deborah Johnson
Deborah Johnson le 19 Jan 2023
I did it in Excel but wanted to learn an easy way in MATLAB. Thanks!

Connectez-vous pour commenter.

Plus de réponses (0)

Produits


Version

R2022b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by