テーブルから読み込ん​だ文字列をワークスペ​ース変数名として活用​する方法について

初めまして
テーブルから読み込んだ文字列を、そのままワークスペース変数名にしたいのですのがどのようにすればよろしいでしょうか?

 Akzeptierte Antwort

交感神経優位なあかべぇ
Bearbeitet: 交感神経優位なあかべぇ am 14 Jul. 2022

1 Stimme

ある文字列の変数名をベースワークスペースに作成(代入)するには、assigninが使用できます。
ベースワークスペース内に、テーブルの各値の変数名を作成する場合は、下記のように実行することで、実現できます。
DCM = table(["KDHEU"; "KHTYDJDB"; "KBFUGENJ"], 'VariableNames', {'KNE'})
for idx = 1 : height(DCM)
% ベースワークスペースに、DCM.KNEの文字列の変数名を作成し、空の値を代入
assignin('base', DCM.KNE(idx), '');
end

1 Kommentar

もったいないお化け
もったいないお化け am 15 Jul. 2022
ありがとうございます!無事できました!

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu データ型の変換 finden Sie in Hilfe-Center und File Exchange

Produkte

Version

R2022a

Community Treasure Hunt

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

Start Hunting!