MATLAB: How to make data appear in a table when a push button is pressed in MATLAB GUI

guiuitable

Hi! I'm developing a GUI in matlab, and one of the Push Buttons, when pressed by the final user, call a external function and generates 3 matrix as result. I want to know how can I make the data of one of this matrix appears in the Table component when this button is pressed

Best Answer

set() the Data property of the uitable to a cell array containing the values. If it is a numeric array you are better off converting it to cell array.
For example,
values = randi(16, 5, 5); %original data
set(handles.uitable1, 'Data', num2cell(values) );