How to bring data from variables(workspace tab) into gui?
9 次查看(过去 30 天)
显示 更早的评论
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 个评论
Geoff Hayes
2017-2-2
swetha suresh's answer moved here
wll you pls send the coding for this question it wll be helps to my project
采纳的回答
Iain
2014-8-13
编辑:Iain
2014-8-13
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.
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Migrate GUIDE Apps 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!