文字ベクトルを変換する
12 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
美紗子 馬渕
am 15 Dez. 2022
Kommentiert: 美紗子 馬渕
am 15 Dez. 2022
現在、以下の状況です。
A=1200行×3列のtable形式
B=’C’の文字ベクトル
この状況から、C=A[1200行×3列のtable]となるようにしたいのですが、どのようにすべきでしょうか。
0 Kommentare
Akzeptierte Antwort
交感神経優位なあかべぇ
am 15 Dez. 2022
変数Bの中の文字列を変数名として格納したいということでしょうか?
少し強引な気がしますが、assigninを無名関数から呼び出してみました。(変数Cをベースワークスペースに保存する用途でしたら、assignin('base' でスマートに実装ができます。)
testFcn();
function testFcn();
tableData = num2cell(zeros(1200, 3), 1);
A = table(tableData{:});
B = 'C';
fcnHdl = @() assignin('caller', B, A);
fcnHdl();
C % 変数Cの内容の確認
end
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Logical finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!