필터 지우기
필터 지우기

How can I change the data type of a column?

조회 수: 115 (최근 30일)
Julozert
Julozert 2020년 5월 27일
댓글: Stephen23 2021년 10월 8일
Hi,
I have a martix with multiple colums and i want to change the data in one column to the data type "char". How can i do that?
  댓글 수: 1
Rik
Rik 2020년 5월 27일
You can't change the data type of part of a variable. You might get close to what you mean with a cell array.

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

답변 (1개)

Cris LaPierre
Cris LaPierre 2020년 5월 28일
I suggest turning your matrix into a table. Each table variable can be a different data type. To change, you could simply do the following:
tbl.Var2 = char(tbl.Var2)

카테고리

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

태그

Community Treasure Hunt

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

Start Hunting!

Translated by