stringとdoubleの配列を結合したいです
Afficher commentaires plus anciens
stringで書かれたデータ(IDという名前の、737x1 string) と、doubleで書かれたデータ(LUTという名の、737x9 double)
を結合したいです。
[ID LUT]で連結するとstringになってしまうのか、数字が使えなくなります
やりかたを教えてください
Réponse acceptée
Plus de réponses (1)
Akira Agata
le 30 Mai 2023
Déplacé(e) : Atsushi Ueno
le 30 Mai 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 commentaire
kenichiro inagaki
le 30 Mai 2023
Déplacé(e) : Atsushi Ueno
le 30 Mai 2023
Catégories
En savoir plus sur データ型の変換 dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!