www.gusucode.com > matlab 案例源码 matlab代码程序 > matlab/ConvertNumericSubsetofTabletoArrayExample.m
%% Convert Numeric Subset of Table to Array % Define the numeric subset of a table to convert to an array. %% % Create a table with nonnumeric data in the first variable. T = table(categorical({'M';'M';'F';'F';'F'}),[38;43;38;40;49],... [71;69;64;67;64],[176;163;131;133;119],... 'VariableNames',{'Gender' 'Age' 'Height' 'Weight'}) %% % Convert |T(:,2:4)| to an array. A = table2array(T(:,2:4)) %% % |A| does not include data from the variable |Gender|.