I need the GUI to search and run scripts, and later plot the result within the UI. any sugestions?

조회 수: 1 (최근 30일)
Hello Matlab-ers :)
Im just being introduced to GUI interface and I need some advice on how to approach my problem.
I have created a .m file that depending on the user input xlsx file, it generates four plots. what I would like to achieve is that I make a GUI that will have a drop down menu and depending on the user selection of data Matlab will look at the designated folder find the xlsx file run the script and then display the findings on the GUI. later in the future I would also like to incorporate in the drop down menu a hold on function hence multiple figures can be ploted on one figure within the GUI.
Would somthing like this be feesable? Could someone point me toward the right direction to implement such a thing?

답변 (1개)

Rutuja Shirali
Rutuja Shirali 2015년 8월 31일
Hi Giorgos,
Based on my understanding of your question, this is what you will need to do:
  1. Create a GUI using GUIDE with "popupmenu" as the uicontrol. You can pass your xlsx files names in the string property for the popupmenu.
  2. Once we have the uicontrol, we will be able to write a callback function for the uicontrol. This function will essentially get the value from the drop down menu and open that particular excel file and read it using the "xlsread"
  3. You can include your script implementation in the call back function so that it executes when user selects a file from the drop down menu.
Refer to the example found on the below link. This example creates a pop up menu and also explains how to implement the call back function.
However, there are various ways of implementing the GUI. Instead of the drop down menu, we can use a push button for browsing the file structure and use the "uigetfile" function in the callback function for the pushbutton. More information about "uigetfile" can be found here:
- Rutuja

카테고리

Help CenterFile Exchange에서 Migrate GUIDE Apps에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by