How to use .xlsx file to import data in a list?

1 回表示 (過去 30 日間)
Valerio Q.
Valerio Q. 2018 年 11 月 26 日
コメント済み: Valerio Q. 2018 年 11 月 29 日
hi everyone, i'm working on a matlab GUI, and i have an empty List2 in my code and a file 'D.xlsx' where in the first row there are strings like this
excel.PNG
where 'test_2.m' is the name of a script which contains a function.
i want to write this row (using a pushbutton),in my List2 in the code, to obtain:
List2={'test_2','test_2','test_2','test_2'};
How can i use the data in the .xlsx file to do this?
Is it possible?
if not, what can i do?

採用された回答

Jayaram Theegala
Jayaram Theegala 2018 年 11 月 29 日
You can use the "xlsread" function to read the text data that you want.
[~, txt] = xlsread('D.xlsx'); % This should return you the strings in form of Cell Array
For more information about the "xlsread" function, click on the following URL:
Hope this helps!
  1 件のコメント
Valerio Q.
Valerio Q. 2018 年 11 月 29 日
yes,it is perfect.
thank you so much :)

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeData Import from MATLAB についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by