How to bring data from variables(workspace tab) into gui?
9 views (last 30 days)
Show older comments
Hello, sorry if this question seems odd or simple to some but I only used Matlab for one semester at university and I am completely new to Guide... I have been watching tutorials on it but I seem to have scrambled my head.
Basically I have created a list of functions to record information from a piece of equipment connected to the computer, it reports these values and starts a camera to run pre defined tasks.
What I need to do is create a gui to make the testing process easier and I want to have the information from the camera displayed on the main gui screen. ie: cam no, cam serial, no of cameras...etc How can I pull the information collected from variables in the workspace tab and list them on the gui?
3 Comments
Geoff Hayes
on 2 Feb 2017
swetha suresh's answer moved here
wll you pls send the coding for this question it wll be helps to my project
Accepted Answer
Iain
on 13 Aug 2014
Edited: Iain
on 13 Aug 2014
I can think of four ways to skin this cat:
1. Declare the variables as global in all workspaces you want access to them. (I'd recommend against this one)
2. Use your GUI's code to generate the variables, rather than putting them into the workspace and pass the data around the GUI using the "userdata" properties of all the controls (which is what I'd recommend)
3. Use "evalin" to get variables out of the base workspace (this method is nasty & horrible)
4. Don't store the variables in the base workspace. Save it to a file, then reload the file in the gui code whenever you need to.
Guide will generally create two functions that get called for each button etc you add. One which takes effect when the button/control gets generated and one which takes effect when it gets clicked. Put your code to interrrogate the camera settings in one of the object creation functions.
More Answers (0)
See Also
Categories
Find more on Migrate GUIDE Apps in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!