whats wrong with my app?

조회 수: 7 (최근 30일)
Muazma Ali
Muazma Ali 2024년 3월 3일
댓글: Muazma Ali 2024년 3월 18일
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
Kojiro Saito
Kojiro Saito 2024년 3월 13일
@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 2024년 3월 14일
편집: Muazma Ali 2024년 3월 14일
@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

댓글을 달려면 로그인하십시오.

답변 (1개)

Kojiro Saito
Kojiro Saito 2024년 3월 14일
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
Muazma Ali
Muazma Ali 2024년 3월 18일
@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 2024년 3월 18일
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

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Matrix Indexing에 대해 자세히 알아보기

제품


릴리스

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by