Passing Data from child app back to parent app.

6 次查看(过去 30 天)
Jason
Jason about 12 hours 前
编辑: Jason about 12 hours 前
Hello. I am trying to pass data from from a child app that is called from within my main app.
My main app is H_TestSoftware.mapp.
In this app there is a pushbutton (PlotManipButtonPushed) that calls a 2nd app (my child app) and passes in an axes and table from the main app.
PlotManipButtonPushed(app, event)
ax1=app.UIAxes3
ex=app.UITable.
PlotAnalysis(ax1, ex); % My Child App
In the startup code of my child app (PlotAnalysis.mapp), I have this:
function startupFcn(app, ax, ex)
app.sourceAxes = ax; % Keep reference to original axes
app.out=ex; % Original parent table I want to pass data back to
where sourceAxes and out are defined in the child app properties
properties (Access = public)
sourceAxes % Keep reference to your original axes
out % used tor eturn data back to calling APP
So in my child app(PlotAnalysis), I have a push button which collects data from a uitable in the (child) app and then I thought I can assign it to the out property (as its linked to the uitable in parent app) and it will then populate the calling apps uitable - but it doesn't
function TestButtonPushed(app, event)
% Get Data from Table (in child app)
T=app.UITable;
data=T.Data;
% send back to calling app's table
app.out.Data=data;
Unable to perform assignment because dot indexing is not supported for variables of this type.
Error in PlotAnalysis/TestButtonPushed (line 1434)
app.out.Data=data;
1: Any suggestions to what Im doing wrong please.
2: Another question, is it possible to use some functions defined in my main app in the child app so I don't have to recreate them in it.
thanks
Jason

回答(0 个)

标签

产品


版本

R2024b

Community Treasure Hunt

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

Start Hunting!

Translated by