필터 지우기
필터 지우기

Calling .m file in app designer that will need to call another .m file to execute the code

조회 수: 67 (최근 30일)
I have a .m file (FILE 1) that calls a function. The function is written in another .m file(FILE). How do i press a button in GUI and run the FILE 1 which will eventually have to call FILE2 to be able to show an output in App Designer. I am a beginner in matlab app desiger and i am having trouble just executing the code.

채택된 답변

Cris LaPierre
Cris LaPierre 2021년 11월 4일
You can execute m-files by calling them by their name in your code. To ensure your app can find the scripts, either place them in the same folder as your app, of add the folder they are in to your MATLAB Path.
See this answer for a related example.
  댓글 수: 6
thin su
thin su 2021년 11월 5일
편집: thin su 2021년 11월 5일
For line 38 of testcode 5 :
net = trainNetwork(eval('X'),eval('Y'),lgraph1,options);
For testcode5ButtonPushed callback :
run('testcode5.m')
Cris LaPierre
Cris LaPierre 2021년 11월 5일
Not sure what your options are, but based on the error messages, you must have the 'plots' option set to 'training-progress', and apparently that is not supported for standalone apps (deployment).
Try changing your 'plots' option to 'none' and see if that allows your app to run.

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Graphics Object Programming에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by