필터 지우기
필터 지우기

Function within function not running in app

조회 수: 3 (최근 30일)
Keshav
Keshav 2023년 12월 7일
답변: SANKALP DEV 2023년 12월 22일
I've got a button on the app which should call the run_start function. Within run_start it should call another function from an if/else statement.
Using the app, the if/else statement is skipped entirely. dMhelium would normally be assigned a value from another function called within the if/else statement.
If I call run_start manually from command window then everything works as intended.

채택된 답변

SANKALP DEV
SANKALP DEV 2023년 12월 22일
Hello Keshav,
I understand that you are encountering an issue when attempting to invoke a function from a button's callback in the App Designer.
The error message "Output element Dihelium (and possibly others) not assigned during call to 'run_start' function", suggests that within your run_start function, there is an expected output variable (in this case, Dihelium) that has not been assigned a value before the function attempts to return it.
Here is a sample code on how to set up a button callback in App Designer to call the “run_start” function with the necessary arguments:
function StartButtonPushed(app, event)
% Retrieve values from UI components
xPosition = app.Xpositionspinner.Value;
altitude = app.altitudespinner.Value;
% Call the run_start function with the retrieved values and additional arguments
dMhelium = run_start(xPosition, altitude, -14, -15);
% Now dMhelium contains the result from run_start function
% You can use dMhelium as needed within your app
end
Hope this helps,
Regards
Sankalp dev

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Develop Apps Using App Designer에 대해 자세히 알아보기

제품


릴리스

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by