Importing Data into GUI Table
조회 수: 4 (최근 30일)
이전 댓글 표시
All,
I'm sure this is probably an easy answer, but how do you write data to a GUI handle (app.UITable)? The method below creates a new, windowed table and writes to it, but I only want to put my data into the already existing one shown below for my user interface.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/840645/image.png)
[file,path] = uigetfile({'*.xlsx'},'Select an Excel File');
figure(app.UIFigure)
PathAndFile = [path,file];
t = readtable(PathAndFile);
fig = uifigure;
uit = uitable(fig,'Data',t);
uit.Data = t;
댓글 수: 3
Voss
2021년 12월 21일
I'm assuming uit and t are your uitable and data. If they are refered to as something else, you'd have to change the syntax, e.g., as in @Image Analyst's answer.
답변 (1개)
Image Analyst
2021년 12월 21일
app.uit.Data = t;
instead of
uit.Data = t;
didn't work, maybe try turning it from a table into an array
app.uit.Data = table2array(t);
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Environment and Settings에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!