Selecting a sheet from an excel file in Matlab GUI
조회 수: 4 (최근 30일)
이전 댓글 표시
Hey, I'm new with Matlab GUI. i was wondering is it possible to load/select a sheet you want to plot in Matlab GUI from a file with multiple sheets? if it isn't possible, then what's the best alternative to this issue?
like this one, i want to use uigetfile code, but i can't choose/write to use a sheet from a mulitple-sheets file
handles.filename=uigetfile('*.xlsx');
filename=handles.filename;
set(handles.edit1,'String', filename)
댓글 수: 0
채택된 답변
Cris LaPierre
2021년 3월 30일
Uigetfile lets you select a file. I suggest using readmatrix or readtable, which allow you to specify which sheet to import using the name or a number. You would have to create your own way of letting the user select the sheet, perhaps through a drop down menu or numeric spinner, etc.
You can use sheetnames to capture the names of the sheets in the spreadsheet you have selected. Use the string array it returns to populate your uicontrol, or its length to same the max numeric value.
추가 답변 (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!