How to use .xlsx file to import data in a list?
조회 수: 1 (최근 30일)
이전 댓글 표시
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](https://www.mathworks.com/matlabcentral/answers/uploaded_files/196938/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?
댓글 수: 0
채택된 답변
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!
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Data Import from MATLAB에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!