whats wrong with my app?
3 views (last 30 days)
Show older comments
I have declared app2 as the input argument in my startup for visualiseringsapp2_1 because it is using the public property from app2 (called antall_soner), and the callingapp is app 3 . ( meaning the visualiseringsapp2_1 is called from app3), as you can see.
I am gettin this error message when I run the app:
Error using visualiseringsapp2_1/startupFcn (line 23)
Not enough input arguments.
Error in visualiseringsapp2_1 (line 115)
runStartupFcn(app, @(app)startupFcn(app, varargin{:}))
Error in app3/DisplayallresultsButtonPushed (line 1855)
visualiseringsapp2_1(app)
Error using matlab.ui.control.internal.controller.ComponentController/executeUserCallback (line 335)
Error while evaluating Button PrivateButtonPushedFcn.
Dot indexing is not supported for variables of this type.
Error in visualiseringsapp2_1/SwitchValueChanged (line 42)
for i = 1:app.Callingapp.antall_soner
Error using matlab.ui.control.internal.controller.ComponentController/executeUserCallback (line 378)
Error while evaluating Switch PrivateValueChangedFcn.
16 Comments
Kojiro Saito
on 13 Mar 2024
@Muazma Ali I understand you want to execute app2 Push Button -> app3, then, app3 Push Button -> visualiserignsapp2_1. Is it correct?
Answers (1)
Kojiro Saito
on 14 Mar 2024
I think the following will work.
app2.mlapp
Set public properties.
properties (Access = public)
antall_soner
end
and button callback is the following.
function App2ButtonPushed(app, event)
app3(app)
end
app3.mlapp
Set private properties.
properties (Access = private)
Callingapp
end
and starup function is as follows.
function startupFcn(app, app2)
app.Callingapp = app2;
end
and Button Push Callback will be.
function App3ButtonPushed(app, event)
visualiseringsapp2_1(app.Callingapp, app)
end
visualiseringsapp2_1.mlapp
Set public properties.
properties (Access = public)
Callingapp
app2
end
and starup function is as follows.
function startupFcn(app, app2, app3)
app.Callingapp = app3;
app.app2 = app2;
app.antall_soner = app2.antall_soner;
end
See Also
Categories
Find more on Develop Apps Using App Designer 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!