MATLAB: How to put two doubles coulmns and third is strings in uitable GUI

matlab guiuitable

I am trying to get the results of my predication to be in two columns where zeros and ones while the third column give me the closest neighbours based on KNN using the Names
i tried the following:
resultdata= [Double' doubleout KNnames];
columnformat = {'numeric','numeric','char'};
set(handles.uitable2, 'Data',resultdata , 'ColumnFormat',columnformat);
but not working I want to be like the following knowing that I loaded the first columns from files and the third two from another excel file
Column1 cloumn2 column 3
1 1 y1
0 1 y3

Best Answer

'Data', [num2cell(k(:)), num2cell(d(:)), knames(:)]
provided your knames is a cell array of strings.