Filter löschen
Filter löschen

MATLAB tableについて

12 Ansichten (letzte 30 Tage)
晃平
晃平 am 20 Feb. 2024
Kommentiert: 晃平 am 26 Feb. 2024
MATLABのtableを使用する際に、各列の配列名を取得するためには、どうすればよいのでしょうか。
↓A,Bをtableから抽出したいです。
   A    B
---------------------------------------
1| 43 44
  2 Kommentare
Kojiro Saito
Kojiro Saito am 20 Feb. 2024
AとBの左右に全角のスペースが入っていますが、実際のデータまたはファイルもそのようになっていますか?
晃平
晃平 am 20 Feb. 2024
コメントありがとうございます。
A,Bは列名、1は行名、43,44はテーブル内の1行目データです。
テーブルデータの列名A,Bの値を取得したいです。 

Melden Sie sich an, um zu kommentieren.

Akzeptierte Antwort

Shunichi Kusano
Shunichi Kusano am 20 Feb. 2024
次のようにアクセスできます。
t = table([43],[44],'VariableNames',{'A','B'})
t = 1x2 table
A B __ __ 43 44
t.Properties.VariableNames
ans = 1x2 cell array
{'A'} {'B'}
  5 Kommentare
Dyuman Joshi
Dyuman Joshi am 21 Feb. 2024
"AとBを変数として使いたい場合はどのようにすればよろしいでしょうか"
Once again, why do you want to do that?
晃平
晃平 am 26 Feb. 2024
解決できました。
ありがとうございます。
str{変数名}=Value{値};
str{1,2}=Value{1,1};

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu 文字と文字列 finden Sie in Help Center und File Exchange

Tags

Produkte


Version

R2022b

Community Treasure Hunt

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

Start Hunting!