Display a Table in GUIDE

조회 수: 17 (최근 30일)
Emilie
Emilie 2020년 2월 13일
편집: Emilie 2020년 2월 13일
I'm working on a project and I have to create an interface which contains a table of data previously filled in another interface.
I want to display it in a figure I've created using GUIDE, in a uitable with the tag 'table'.
function s_OpeningFcn(hObject, eventdata, handles, varargin)
% Choose default command line output for select_tron
handles.output = hObject;
movegui('center');
U = getappdata(0,'U');
Tab = struct2table(U.tab,'AsArray',true);
set(handles.table,'Data',Tab);
% Update handles structure
guidata(hObject, handles);
I tried with handles.table.Data=Tab; but it doesn't work neither.
And with uitable(gcf,'Data',Tab)
I get this error :
Error using matlab.ui.control.Table/set
Functionality not supported with figures created with the figure function. For more information, see Graphics Support in App
Designer.
Error in select_tron>select_tron_OpeningFcn (line 99)
set(handles.tableau,'Data',Tab);
Error in gui_mainfcn (line 220)
feval(gui_State.gui_OpeningFcn, gui_hFigure, [], guidata(gui_hFigure), varargin{:});
Error in select_tron (line 17)
gui_mainfcn(gui_State, varargin{:});

채택된 답변

Walter Roberson
Walter Roberson 2020년 2월 13일
https://www.mathworks.com/help/matlab/ref/matlab.ui.control.table-properties.html
uitable only supports setting Data to a table() if the uitable is a child of a uifigure(), rather than the child of a figure()

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Develop Apps Using App Designer에 대해 자세히 알아보기

제품


릴리스

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by