How to avoid clearing workspace in MATLAB App button ?
Show older comments
Hi,
I have existing variables in matlab worksace.
I am creating on app in which there is Button. If I click button then all workspace variables get erased .
How to avoid erasing of these workpace variables ?
The app works on the worksspace data.
3 Comments
"The app works on the worksspace data."
Which workspace?
An app should operate on data in the app's workspace:
https://www.mathworks.com/help/matlab/creating_guis/share-data-across-callbacks-in-app-designer.html
Trying to magically manipulate data in other workspaces (e.g. the base workspace) is not a good approach.
Kaustubh hike
on 23 Aug 2021
Stephen23
on 23 Aug 2021
"I want it should work on matlab workspace."
Every workspace in MATLAB is a MATLAB workspace.
Did you read the links that I gave you? They explain the basics about different MATLAB workspaces.
The best solution by far is to pass the data to your app and process it within the app workspaces. Is there any particular reason why you cannot use the best approach, but instead need to use a slow, complex, buggy approach to accessing your data?
Accepted Answer
More Answers (0)
Categories
Find more on Workspace Variables and MAT Files 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!