Getting output from an app into the calling workspace

조회 수: 79 (최근 30일)
George Pavlath
George Pavlath 2022년 6월 9일
댓글: George Pavlath 2022년 6월 13일
I have a MatLAB script that runs fine. I want to add a GUI at the front of the app to make it easier for the user. I am using appdesigner for the GUI. The MatLAB script calls the app at the beginning. This part works ok. The app lets the user select an entry, a number from a drop down list, and store it in the app's workspace in a variable called numSelect. The drop down list is populated fine and when I select an entry from the drop down list it is stored fine in numSelect. I cannot figure out how to get the selected number, numSelect, from the app's workspace into the workspace of the calling script. I have searched the community forums and MatLAB help but have not found how to do this.
  댓글 수: 3
George Pavlath
George Pavlath 2022년 6월 9일
This doesn't help as the script outputs a numeric array to the workspace at present. If I call the script from the app, I still need the numeric array returned into the base workspace.
dpb
dpb 2022년 6월 9일
A function will return its return variable when it terminates -- have the app terminate and return to the command line when the function completes its work.
Scripts are to be avoided, anyways...except for just playing at the command line.

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

답변 (1개)

Benjamin Kraus
Benjamin Kraus 2022년 6월 9일
This question has been asked before, and there are a few different answers threads with ideas for how to do this. Here are two:
  댓글 수: 1
George Pavlath
George Pavlath 2022년 6월 13일
AFter some digging at the links and some trial and error, I was able to get an app to output data to teh calling script. The app acts as a GUI.

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

카테고리

Help CenterFile Exchange에서 Develop Apps Using App Designer에 대해 자세히 알아보기

제품


릴리스

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by