Browse File and Load Data on Table in App Designer

16 ビュー (過去 30 日間)
DARLINGTON ETAJE
DARLINGTON ETAJE 2021 年 7 月 22 日
回答済み: Sivani Pentapati 2021 年 8 月 6 日
Hi. I am trying to put this code on the callback of a function but it is not working. Please me out. When I click, it leads me to look for the file but when I try to open, I get errors...I have tried different methods like readtable, importdata...and so on
[file,path] = uigetfile({'*.xlsx';'*.csv';'*.m';'*.slx';'*.mat';'*.*'},...
'File Selector');
Data23=uiimport(file);
app.UITable8.Data=Data23;

回答 (1 件)

Sivani Pentapati
Sivani Pentapati 2021 年 8 月 6 日
Based on my understanding, you are trying to load data from a file into a table. uiimport loads data from a file into a structure so assigning it to data of table might throw an error. You can resolve the error by assigning the corresponding attributes of structure to table. The below code is a possible workaround for data in struct Data23
app.UITable.Data= Data23.data;
app.UITable.ColumnName = Data23.colheaders;
You can also refer to the documentation of uiimport for more information

カテゴリ

Help Center および File ExchangeDevelop Apps Using App Designer についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by