MATLAB Answers

how do I get the value of a variable from the base workspace in my GUI??

322 views (last 30 days)
Edward
Edward on 25 Oct 2012
Commented: Vadim Kachan on 29 Jul 2019
Hi,
i have a large workspace (±400 variables) and i want to write a script for my gui, where i can put in a variable in an edit box, press a button next to it, and then the value of this variable has to appear in an other edit box. I'm really stuck on this, does anybody know how to do this???
Greetings
  2 Comments
Edward
Edward on 25 Oct 2012
one edit box to for the name of a variable, and one edit box where the value corresponding to this variable appears. Also there is a button, which has to run the script that gets de data from the workspace an shows it in the second edit box.

Sign in to comment.

Accepted Answer

Milos
Milos on 25 Oct 2012
You can use this:
varName = evalin('base', 'varNameInWorkspace');
  8 Comments

Sign in to comment.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!