How to read excel data in matlab app designer and use it for further calculation eg. plot data?

4 ビュー (過去 30 日間)
garima
garima 2020 年 4 月 19 日
コメント済み: Stephen23 2025 年 2 月 17 日 6:09
hello,
I want to read to excel file and want to excess the data for further calculation. the program is written below, here i have used pushbutton and drop down for reading data. Based on option it will read the excel data:
% Button button pushed function
function ButtonButtonPushed(app)
value = app.DropDown.Value;
if value == 'Option 1'
counter=0;
app.EditField.Value = value;
% % INPUT THE FILE NAME AND DETAILS
[FileName,PathName] = uigetfile('*.xls','Select the Excel File','MultiSelect','on');
[num, txt]= xlsread([PathName,FileName{1,1}]);
[num1, txt1]= xlsread([PathName,FileName{1,2}]);
[m1,n1]=size(num);
[m2,n2]=size(num1);
a = txt(27:28,2);
is it correct way to read the excel data and excess the row and column data?
thank you!

回答 (1 件)

Rahul
Rahul 2025 年 2 月 17 日 5:55
The approach described by you for reading excel data into MATLAB AppDesigner appears to be in the right direction.
Some additions that can be considered are:
  • Adding another Pushbutton, and using its callback to plot the accessed data.
  • Adding edge-case error handling incase no file is selected by the user.
The following MATLAB Answers can be referred:
Hope this helps! Thanks.

カテゴリ

Help Center および File ExchangeSpreadsheets についてさらに検索

製品


リリース

R2016a

Community Treasure Hunt

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

Start Hunting!

Translated by