MATLAB: Popupmenu in the uitable

columnformatpopupmenuuitable

I have a popupmenu in the uitable: set(handles.uitable1, 'ColumnFormat', {{'A' 'R'}) And I want to do, if I choose 'A', than do something, for example, 2+2, else 2-2. How to format function, that it does, what I want?

Best Answer

You should use CellEditCallback:
set(handles.uitable1, 'ColumnFormat', {'A' 'R'},'CellEditCallback',@myFun)
function myfun(varargin)
% Check for the value
% Do stuff
end
Oleg