adding structure in a table
45 ビュー (過去 30 日間)
古いコメントを表示
I have a table called T which is a large dataset of 50 columns and 1000 rows. I have a struct called Table which has 4 fields as:
Table Year= 2012
Table Total= 2000
Table Length= 5 years
Can i somehow add this structure to my table properties?
Like this:
Description: 'Population Table'
UserData: []
DimensionNames: {'Row' 'Variables'}
VariableNames: {1×50 cell}
VariableDescriptions: {1×50 cell}
RowNames: {}
% TableInfo: Somewhere here?
0 件のコメント
回答 (1 件)
madhan ravi
2019 年 8 月 8 日
編集済み: madhan ravi
2019 年 8 月 9 日
https://in.mathworks.com/help/matlab/ref/table.html#mw_eed92014-a41e-4ffa-a43d-4f1b948c083c - follow the instructions in the link
T = table((1:10).',(2:11).') % sample table
t.S = 1:5; % sample structure
t.K = rand;
f = fieldnames(t);
c = struct2cell(t);
T = addprop(T,f,repmat({'table'},size(f)))
for k = 1:numel(f)
T.Properties.CustomProperties.(f{k}) = c{k};
end
T.Properties
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Tables についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!