How to bring data from variables(workspace tab) into gui?
8 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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 commentaires
Geoff Hayes
le 2 Fév 2017
swetha suresh's answer moved here
wll you pls send the coding for this question it wll be helps to my project
Réponse acceptée
Iain
le 13 Août 2014
Modifié(e) : Iain
le 13 Août 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.
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Migrate GUIDE Apps dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!