File Exchange

image thumbnail

UIGETVARIABLES: Dialog to pass variables from workspace into GUI

version (8.75 KB) by Michelle Hirsch
UIGETVARIABLES creates a dialog box for selecting variables from the base workspace


Updated 17 Aug 2015

From GitHub

View Version History

View license on GitHub

Editor's Note: This file was selected as MATLAB Central Pick of the Week

It is common to write GUI-driven applications which require end users to pass in some variables from the workspace when calling the function to launch the GUI, e.g. myPlottingGUI(X,Y)
UIGETVARIABLES allows your users to interactively select workspace variables from a dialog instead of having to type variable names when launching your app. You can restrict which types of variables are allowed for each input, making it easier for users to successfully pass the right data into your app.

Give it a try and let me know what you think!

Cite As

Michelle Hirsch (2021). UIGETVARIABLES: Dialog to pass variables from workspace into GUI (, GitHub. Retrieved .

Comments and Ratings (12)

Nicolas Gaborel


Thank you so much

schmidt schmidt


Cool and useful!! Thanks for sharing.

Lionel Smith

Exactly Michelle,
I would also propose to pick a column or a line from an array.
To be honest it's a bit painful to spilt a workspace into several arrays to make the GUI usable.
Looking forward to have it working !


Michelle Hirsch

Great suggestion, Michael. There's no easy way to do it right now. Ideally, I guess the interface would treat structs (and tables) like workspaces, and allow you to drill into them to pick individual variables.

Anybody out there want to take a stab at adding this enhancement?

- Michelle

Lionel Smith


I was wondering if it could be possible to have access to a specfic field into a struct variable of the workspace.

Nice job by the way.


Gijs van Oort

Adam Filion

Hi Scott,

As an enhancement request, it'd be nice if this could also return the names of the variables selected from the workspace, for use in things like labeling axes.

Steph T

Simple, effective, and does the job very nicely! Exactly what I was looking for. thanks!

Szilárd Németh

I was about to create an app and was exactly looking for something like this. Great one, thanks Scott!

Adam Filion

Very useful! Thanks!

MATLAB Release Compatibility
Created with R2012a
Compatible with any release
Platform Compatibility
Windows macOS Linux

Inspired: Volumetric Data Explorer, Simple Viewer 3D

Community Treasure Hunt

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

Start Hunting!