why some variables on my gui program doesn't go to workspace

16 views (last 30 days)
i made this GUI and it has some calculation and variables in it but these variables never go to workspace why? i tried the same algorithme on a seperate script and it works perfectly with variables stored in the workspace but it doesnt work in my gui
  1 Comment
Stephen23
Stephen23 on 9 Nov 2017
"...but these variables never go to workspace why?"
They do. They are defined in the function workspace, and do not just magically appear in the base workspace. Which is exactly how it be: every function has its own independent workspace:
If you want to pass data between workspaces then use the methods shown in the MATLAB documentation:
I would recommend that you use nested functions or guidata.

Sign in to comment.

Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!