テーブルから読み込んだ文字列をワークスペース変数名として活用する方法について
30 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
初めまして
テーブルから読み込んだ文字列を、そのままワークスペース変数名にしたいのですのがどのようにすればよろしいでしょうか?
0 commentaires
Réponse acceptée
交感神経優位なあかべぇ
le 14 Juil 2022
Modifié(e) : 交感神経優位なあかべぇ
le 14 Juil 2022
ある文字列の変数名をベースワークスペースに作成(代入)するには、assigninが使用できます。
ベースワークスペース内に、テーブルの各値の変数名を作成する場合は、下記のように実行することで、実現できます。
DCM = table(["KDHEU"; "KHTYDJDB"; "KBFUGENJ"], 'VariableNames', {'KNE'})
for idx = 1 : height(DCM)
% ベースワークスペースに、DCM.KNEの文字列の変数名を作成し、空の値を代入
assignin('base', DCM.KNE(idx), '');
end
Plus de réponses (0)
Voir également
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!