MATLAB: Passing Data between Apps

app designerMATLABmulti windowpassing data

I'm making an app that calls up additional apps for input.
I've managed to do this successfully when all the variables are created in the second app.
However, I now need to make an app that has a drop down input that draws its items from the main app.
The guide on multi window apps is very good on showing how to "pass down" data, but not on "passing up" data.
I really need some help on this!

Best Answer

The documentation you mentioned, Creating Multiwindow Apps in App Designer, shows how to pass data both ways. If there's a section that is unclear, I'd be glad to help out with that step.
The main idea it to get access to the app handle for both apps. This answer also reviews some strategies.
Update: Here's a general idea of how to access external app data within a second app.
Step 1: Set up the Payroll app to receive one additional input which will be the app handle to the app that calls Payroll.
function startupFcn(app, callerApp)
Step 2: Within the Payroll app, delcare the callerApp as a private property.
It will look something like this
properties (access = private)
callerApp % handle to caller app
end
Step 3: Define callerApp in the Payroll startupFcn
function startupFcn(app, callerApp)
app.callerApp = callerApp;
end
Step 4: Access the callerApp data anywhere within your app.
function updatePayroll(app)
app.callerApp.PayDate
app.callerApp.PayName
end