How can I create table of fixed values in MATLAB gui?
2 ビュー (過去 30 日間)
古いコメントを表示
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?
0 件のコメント
回答 (1 件)
Geoff Hayes
2016 年 1 月 16 日
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.
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Migrate GUIDE Apps についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!