Using workspace variables inside GUIDE

2 Ansichten (letzte 30 Tage)
Rodrigo Orderique
Rodrigo Orderique am 16 Jul. 2017
Kommentiert: Image Analyst am 16 Jul. 2017
Hello everyone.
New to MATLAB here. I'm creating a GUIDE that, by the click of a pushbutton, will generate a plot. That plot is generated via a function that uses variables located in the workspace. I'm not sure as to how I can bring the data from those variables into the GUI as well as to pass that information to the function.
Any help would be appreciated,
Thanks!

Akzeptierte Antwort

Image Analyst
Image Analyst am 16 Jul. 2017
I don't like that way of operating, but if you insist, use evalin():
This example extracts the value of the variable var in the MATLAB base workspace and captures the value in the local variable v:
v = evalin('base', 'var');
  2 Kommentare
Rodrigo Orderique
Rodrigo Orderique am 16 Jul. 2017
Thanks for the quick answer. How would you approach this problem? I'm new so any better way of doing things is welcome.
Image Analyst
Image Analyst am 16 Jul. 2017
I have all my code in one program. I find it's easier to have everything done on one GUI that takes up the whole screen rather than having to run multiple programs and have multiple GUI windows up, or having to interact sometimes in the command window, and then getting all the various programs to communicate with each other. If the programs are so large and different from each other, then I'd just have one save it's final output in a .mat file and have the other program load that .mat file.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Variables finden Sie in Help Center und File Exchange

Produkte

Community Treasure Hunt

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

Start Hunting!

Translated by