whats wrong with my app?

12 visualizaciones (últimos 30 días)
Muazma Ali
Muazma Ali el 3 de Mzo. de 2024
Comentada: Muazma Ali el 18 de Mzo. de 2024
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 comentarios
Kojiro Saito
Kojiro Saito el 13 de Mzo. de 2024
@Muazma Ali I understand you want to execute app2 Push Button -> app3, then, app3 Push Button -> visualiserignsapp2_1. Is it correct?
Muazma Ali
Muazma Ali el 14 de Mzo. de 2024
Editada: Muazma Ali el 14 de Mzo. de 2024
@Kojiro Saito Yes, each app leads to the other.
And I want to use the public property called antall_soner from app2 in visualiseringsapp2_1

Iniciar sesión para comentar.

Respuestas (1)

Kojiro Saito
Kojiro Saito el 14 de Mzo. de 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
  2 comentarios
Muazma Ali
Muazma Ali el 18 de Mzo. de 2024
@Kojiro Saito Hi again! :)
I dont understand the purpose of writing
app.app2 = app2;
app.antall_soner = app2.antall_soner;
Please explain, :)
Muazma Ali
Muazma Ali el 18 de Mzo. de 2024
In addition to what you wrote I declared antall_soner as a public property in visualiseringsapp2_1. Because I was getting error again saying unrecogninsed variable antall_soner for class of visualiseringsapp2_1

Iniciar sesión para comentar.

Categorías

Más información sobre Develop Apps Using App Designer en Help Center y File Exchange.

Productos


Versión

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by