How to bring data from variables(workspace tab) into gui?

12 views (last 30 days)
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
Jonathan O'Neill
Jonathan O'Neill on 13 Aug 2014
Well the first thing I aim to do is select the camera in the gui, from this I am going to try and make a code that will automatically display all of the information about the given camera, but I am unsure of how to program this in guide. Once all the information is present the user will be able to enter a few test conditions and then hit run
If I "run" the process in normal matlab it gathers the info, but Im not sure how to program guide to do the same, or how to just get guide to display it.
I tried to create a table, but then I needed a new table for every variable, and as far as I know it wont update the details of the table when I change the selected camera as its a "static" entity (for lack of a better word).
Geoff Hayes
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

Sign in to comment.

Accepted Answer

Iain
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)

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!