フィルターのクリア

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 Center および File ExchangeTables についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by