How to convert categorical data to double with unique rows

조회 수: 4 (최근 30일)
Deborah Johnson
Deborah Johnson 2023년 1월 19일
댓글: Deborah Johnson 2023년 1월 19일
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'

채택된 답변

David Hill
David Hill 2023년 1월 19일
편집: David Hill 2023년 1월 19일
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
Deborah Johnson
Deborah Johnson 2023년 1월 19일
I did it in Excel but wanted to learn an easy way in MATLAB. Thanks!

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Spreadsheets에 대해 자세히 알아보기

제품


릴리스

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by