how to use categorical in uitable
hi, I want to choose as value in a table field ‘Fil’ or ‘Stat’
cat=categorical({‘Fil’;’Stat’});
name={‘A’,’B’};
nrows=numel(name);
VNAMES={‘Draw’;’Filt_Stat’};
VTYPES=[{‘logical’},{cat}];
T=table(‘Size’,[nrows,numel(VNAMES)],’VariableTypes’,VTYPES,’VariableNames’,VNAMES); % empty t
T.Draw=repmat({true},nrows,1);
ct=cell(1, numel(name));
ct(:) = {cat{2}};
T.Filt_Stat=ct’;
app.Portfolio_UITable.Data=T;
i get this error:
Error using table
Specify variable types as a string array or a cell array of character
vectors, such as ["string", "datetime", "double"].hi, I want to choose as value in a table field ‘Fil’ or ‘Stat’
cat=categorical({‘Fil’;’Stat’});
name={‘A’,’B’};
nrows=numel(name);
VNAMES={‘Draw’;’Filt_Stat’};
VTYPES=[{‘logical’},{cat}];
T=table(‘Size’,[nrows,numel(VNAMES)],’VariableTypes’,VTYPES,’VariableNames’,VNAMES); % empty t
T.Draw=repmat({true},nrows,1);
ct=cell(1, numel(name));
ct(:) = {cat{2}};
T.Filt_Stat=ct’;
app.Portfolio_UITable.Data=T;
i get this error:
Error using table
Specify variable types as a string array or a cell array of character
vectors, such as ["string", "datetime", "double"]. hi, I want to choose as value in a table field ‘Fil’ or ‘Stat’
cat=categorical({‘Fil’;’Stat’});
name={‘A’,’B’};
nrows=numel(name);
VNAMES={‘Draw’;’Filt_Stat’};
VTYPES=[{‘logical’},{cat}];
T=table(‘Size’,[nrows,numel(VNAMES)],’VariableTypes’,VTYPES,’VariableNames’,VNAMES); % empty t
T.Draw=repmat({true},nrows,1);
ct=cell(1, numel(name));
ct(:) = {cat{2}};
T.Filt_Stat=ct’;
app.Portfolio_UITable.Data=T;
i get this error:
Error using table
Specify variable types as a string array or a cell array of character
vectors, such as ["string", "datetime", "double"]. how to use categorical in uitable MATLAB Answers — New Questions