I am trying to create a dropdown option in the third column of my table. If I use the documentation data (variable Data) with my dropdown choices, it works. If I try using my data (variable myData), it does not work. I have also tried the categorical replacement for the specific column in the table and that did not work for me. Thanks for your insight.
% Generate Datamaterial_list = {'material1','material2','material3'};num = [1 2 3]';type = {'A', 'B', 'C'}';% Generate "Choose" for last columnchoose = repmat({'Choose'},length(num),1);% Build tablemy_table = table(num,type,choose);myData = table2cell(my_table);fig = uifigure;% Matlab documentation dataData = {'Andrew' 31 'Male' 'Choose'; ... 'Bob' 41 'Male' 'Choose'; ... 'Anne' 20 'Female' 'Choose';};% Build uitableuit = uitable('Parent', fig, ... 'Position', [100 150 380 100], ... 'ColumnFormat',({[] [] [] material_list}), ... 'ColumnEditable',true, ... 'Data',myData); % myData does not work, % Data works.
Best Answer