Selecting a sheet from an excel file in Matlab GUI

조회 수: 4 (최근 30일)
Rafael Ferdinandus
Rafael Ferdinandus 2021년 3월 30일
댓글: Rafael Ferdinandus 2021년 4월 3일
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)

채택된 답변

Cris LaPierre
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.
  댓글 수: 1
Rafael Ferdinandus
Rafael Ferdinandus 2021년 4월 3일
ah i see. i've found another thread that discuss about this stuff too so i'll look up, but thak you bery much for the answer

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Environment and Settings에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by