www.gusucode.com > matlab 案例源码 matlab代码程序 > matlab/DetermineifSubsetofTableIsTableExample.m

    %% Determine if Subset of Table Is Table  

%% 
% Create a table, |T|. 
T = table(categorical({'M';'F';'M'}),[45 45;41 32;40 34],...
    {'NY';'CA';'MA'},[true;false;false])  

%% 
% Determine if the subset of table |T| that contains only the second and
% fourth variables is a table. 
istable(T{:,[2 4]}) 

%%
% Conversely, accessing data with curly braces, |T{:,[2 4]}|, returns a
% matrix and not a table.