Why does 'varfun' exclude rows with an empty cell?
古いコメントを表示
When I use 'varfun' with a grouping variable that contains empty char row vectors (''), the resulting table excludes these rows. See the following example:
tblInput = table({'';'';''},[10;20;30],[40;50;60],[7, 1;8, 2;9,3]);
tblInput.Properties.VariableNames = {'X','Y','Z','Quantity'};
strGroupingVariables = {'X','Y','Z'};
tblEmpty = varfun(@nansum,tblInput,'GroupingVariables',strGroupingVariables, 'InputVariables', {'Quantity'})
result:
tblEmpty =
0×5 empty table
Is this expected behavior? How do I get the resulting table to include the columns of 'X', just as an empty string?
採用された回答
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Tables についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!