stringとdoubleの配列を結合したいです
Show older comments
stringで書かれたデータ(IDという名前の、737x1 string) と、doubleで書かれたデータ(LUTという名の、737x9 double)
を結合したいです。
[ID LUT]で連結するとstringになってしまうのか、数字が使えなくなります
やりかたを教えてください
Accepted Answer
More Answers (1)
Akira Agata
on 30 May 2023
Moved: Atsushi Ueno
on 30 May 2023
+1
以下、簡単のためサイズが 3×1 の ID (string型) と 3×9 の LUT (double型) で説明します。
% ID, LUTのサンプル
ID = ["Taro"; "Jiro"; "Saburo"];
LUT = rand(3, 9);
% 方法1: 単純に table 型変数として結合
T1 = table(ID, LUT)
% 方法2: LUTの各列が table 型変数の列となるように結合
T2 = [table(ID), array2table(LUT)]
1 Comment
kenichiro inagaki
on 30 May 2023
Moved: Atsushi Ueno
on 30 May 2023
Categories
Find more on データ型の変換 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!