テーブルから読み込んだ文字列をワークスペース変数名として活用する方法について
11 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
初めまして
テーブルから読み込んだ文字列を、そのままワークスペース変数名にしたいのですのがどのようにすればよろしいでしょうか?

0 Commenti
Risposta accettata
交感神経優位なあかべぇ
il 14 Lug 2022
Modificato: 交感神経優位なあかべぇ
il 14 Lug 2022
ある文字列の変数名をベースワークスペースに作成(代入)するには、assigninが使用できます。
ベースワークスペース内に、テーブルの各値の変数名を作成する場合は、下記のように実行することで、実現できます。
DCM = table(["KDHEU"; "KHTYDJDB"; "KBFUGENJ"], 'VariableNames', {'KNE'})
for idx = 1 : height(DCM)
% ベースワークスペースに、DCM.KNEの文字列の変数名を作成し、空の値を代入
assignin('base', DCM.KNE(idx), '');
end
Più risposte (0)
Vedere anche
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!