MATLAB: Creating uitable with multiple data types

MATLABtable uitable

I have a table that I need to open as a uitable. The original table has both character arrays and numeric variables. I get the following error when creating the uitable, .
Cannot concatenate the table variables _____ and ____, because their types are double and cell.
This isn't my exact code, but illustrates my problem…
%Build Table
SectionID = {'A';'B';'C';'D'};
Description = {'First';'Second';'Third';'Fourth'};
Measurement1 = [5.2;5.0;5.0;5.8];
Measurement2 = [10;11;15;10];
T = table(SectionID,Description,Measurement1,Measurement2);
%Set up figure
handles.fig = figure('Position',[400,400,500,190]);
handles.T = T;
%UI Table - TEXT ONLY - WORKS
uitable(handles.fig,'Data',handles.T{:,[1,2]},'ColumnWidth',{100},...
'ColumnName',handles.T.Properties.VariableNames([1,2]),...
'Position',[20,20,450,150]);
%UI Table - NUMERIC ONLY - WORKS
uitable(handles.fig,'Data',handles.T{:,[3,4]},'ColumnWidth',{100},...
'ColumnName',handles.T.Properties.VariableNames([3,4]),...
'Position',[20,20,450,150]);
%UI Table - TEXT AND NUMERIC - DOES NOT WORK
uitable(handles.fig,'Data',handles.T{:,:},'ColumnWidth',{100},...
'ColumnName',handles.T.Properties.VariableNames(:),...
'Position',[20,20,450,150]);

Best Answer

Indeed, the error message is right--"you can't do that!" of trying to concatenate cell array and non-cell array values.
You'll have to convert the table into a cell array to pass to uitable; it isn't table-aware so can't use the table directly, either.
I don't have release that includes the table class, but I'd think table2cell(T) would be just the ticket here...see table2cell()