How to get calculations in workspace from GUI?
1 view (last 30 days)
Show older comments
Hi, I have developed a GUI where user will give inputs. The complete calculation is iterated till 2400 seconds. Now I get only final output. I want to get values for each step in workspace like when we run a .m file. How to do that?
0 Comments
Accepted Answer
Geoff Hayes
on 17 May 2015
Edited: Geoff Hayes
on 17 May 2015
Adi - instead of writing your variables to the workspace, why not just save the results (of the 2400 seconds) to a mat file using save? I think that may be a cleaner approach. Or is there a particular reason why you want to try and access this data from the workspace?
2 Comments
Stephen23
on 18 May 2015
Edited: Stephen23
on 18 May 2015
Each function already has its own workspace, and it is easy to look at the variables inside any workspace using the debugging tools. Although it sounds like a great idea to move everything to the main workspace just to have a look at it, it is much more robust and efficient to use the debugging tools to look at the data exactly in the workspace where it is. This has multiple advantages, including smaller memory usage, ability to trigger based on events of conditions, ability to run arbitrary code in the middle of code execution and the fact that the code stays unchanged.
Learn how to use MATLAB's programming tools and your own life gets much easier and more productive. In your case, where the output is not what you expect, you could use the breakpoints with conditions.
More Answers (0)
See Also
Categories
Find more on Whos 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!