MATLAB Answers

accessing variables in multiple .mlapp files - Matlab app designer

2 views (last 30 days)
Joseph Kutteh
Joseph Kutteh on 11 Jun 2021
Commented: Adam Danz on 15 Jun 2021
i am wondering how to share variables between 2 matlab app designer (.mlapp) files. I have one file GUI2.mlapp and another file GUI4.mlapp. I would like to share a variable from GUI.mlapp to GUI4.mlapp. How am i able to do this?
matlab version: R2019B
Thank you!

Accepted Answer

Adam Danz
Adam Danz on 11 Jun 2021
Although that page comprehensively explains the process, here's an answer that shows a step-by-step process of declaring app properties. You can use "public" properties.
Adam Danz
Adam Danz on 15 Jun 2021
The line below with the leftward arrow is accessing the name propery of GUI2!
If this function is within GUI4, then use since the app content pertains to GUI4.
%my second app called GUI4.mlapp
function startupFcn(app)
app2handle = GUI2 % <------------------------

Sign in to comment.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!