このページの翻訳は最新ではありません。ここをクリックして、英語の最新版を参照してください。
table2cell
テーブルの cell 配列への変換
説明
例
テーブルの cell 配列への変換
5 つの行と 3 つの変数をもつ table T
を作成します。
T = table(categorical(["Y";"Y";"N";"N";"N"]),[38;43;38;40;49],... [124 93;109 77; 125 83; 117 75; 122 80],... 'VariableNames',["Smoker" "Age" "BloodPressure"],... 'RowNames',["Chang" "Brown" "Ruiz" "Lee" "Garcia"])
T=5×3 table
Smoker Age BloodPressure
______ ___ _____________
Chang Y 38 124 93
Brown Y 43 109 77
Ruiz N 38 125 83
Lee N 40 117 75
Garcia N 49 122 80
T
を cell 配列に変換します。
C = table2cell(T)
C=5×3 cell array
{[Y]} {[38]} {[124 93]}
{[Y]} {[43]} {[109 77]}
{[N]} {[38]} {[125 83]}
{[N]} {[40]} {[117 75]}
{[N]} {[49]} {[122 80]}
C
は 5 行 3 列の cell 配列です。
table プロパティ T.Properties.VariableNames
を C
と垂直方向に連結して、cell 配列の列見出しを含めます。
[T.Properties.VariableNames;C]
ans=6×3 cell array
{'Smoker'} {'Age'} {'BloodPressure'}
{[Y ]} {[ 38]} {[ 124 93]}
{[Y ]} {[ 43]} {[ 109 77]}
{[N ]} {[ 38]} {[ 125 83]}
{[N ]} {[ 40]} {[ 117 75]}
{[N ]} {[ 49]} {[ 122 80]}
T.Properties.VariableNames
は、変数名が string 配列からあらかじめ割り当てられていた場合でも、変数名を文字ベクトルの cell 配列として保存します。
入力引数
T
— 入力テーブル
table | timetable
入力 table。table または timetable として指定します。
T
が m
行 n
列の table または timetable である場合、C
は m
行 n
列の cell 配列です。
拡張機能
tall 配列
メモリの許容量を超えるような多数の行を含む配列を計算します。
この関数は tall 配列を完全にサポートしています。詳細については、tall 配列を参照してください。
C/C++ コード生成
MATLAB® Coder™ を使用して C および C++ コードを生成します。
この関数はコード生成を完全にサポートしています。詳細については、table のコード生成 (MATLAB Coder)を参照してください。
分散配列
Parallel Computing Toolbox™ を使用して、クラスターの結合メモリ上で大きなアレイを分割します。
この関数は分散配列を完全にサポートしています。詳細については、分散配列を使用した MATLAB 関数の実行 (Parallel Computing Toolbox)を参照してください。
バージョン履歴
R2013b で導入
参考
MATLAB コマンド
次の MATLAB コマンドに対応するリンクがクリックされました。
コマンドを MATLAB コマンド ウィンドウに入力して実行してください。Web ブラウザーは MATLAB コマンドをサポートしていません。
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)