Borrar filtros
Borrar filtros

How can I create table of fixed values in MATLAB gui?

2 visualizaciones (últimos 30 días)
Gee Cheng Mun
Gee Cheng Mun el 16 de En. de 2016
Respondida: Geoff Hayes el 16 de En. de 2016
I would like to create a table of fixed values to inform the users regarding the time frame. For example, my pop-up menu have strings like 'Frame 13', 'Frame 14' and so on. How can I construct a table to inform the users that Frame 13 has a duration of 130 - 200s?

Respuestas (1)

Geoff Hayes
Geoff Hayes el 16 de En. de 2016
Just use a uitable. For example, if your pop-up menu is named popupmenu1 and your table is named uitable1, then in the OpeningFcn of your GUI, you could do something like
function PopUpUitableExample_OpeningFcn(hObject, eventdata, handles, varargin)
handles.output = hObject;
guidata(hObject, handles);
% populate the popup menu
frameNames = {'Frame 1', 'Frame 2', 'Frame 3'};
set(handles.popupmenu1,'String',frameNames);
% populate the popup menu
frameNames = {'Frame 1'; 'Frame 2'; 'Frame 3'};
set(handles.popupmenu1,'String',frameNames);
% populate the uitable
frameSpeeds = {'0 - 25s'; '26 - 50s'; '51 - 75s'};
set(handles.uitable1,'RowName',frameNames,'Data',frameSpeeds,'ColumnName',{'Speed (seconds)'});
In the above, cell arrays of strings are used to populate both the popup menu and the uitable. See the attached for a very simple example.

Categorías

Más información sobre Migrate GUIDE Apps en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by