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

    %% Determine Whether Workspace Variable Is Categorical Array  

%% 
% Create a workspace variable, |A|. 
A = categorical({'red' 'green' 'violet'; 'orange' 'red' 'yellow'})  

%% 
% Verify that the workspace variable, |A|, is a categorical array. 
tf = iscategorical(A) 

%%
% |A| is a 2-by-3 categorical array.