Using workspace variables inside GUIDE

2 visualizzazioni (ultimi 30 giorni)
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!

Risposta accettata

Image Analyst
Image Analyst il 16 Lug 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 Commenti
Rodrigo Orderique
Rodrigo Orderique il 16 Lug 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 il 16 Lug 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.

Accedi per commentare.

Più risposte (0)

Categorie

Scopri di più su Variables in Help Center e File Exchange

Prodotti

Community Treasure Hunt

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

Start Hunting!

Translated by