How to use .m files from complex matlab program in app designer code

I'm trying to design a interface for expanded MatLab program in app designer. I'm wondering how to use several .m files in app designer code view.

답변 (1개)

Arthur Roué
Arthur Roué 2020년 7월 23일
편집: Arthur Roué 2020년 7월 23일

0 개 추천

You can't do this directly in appdesigner interface. A workaround is to create a class folder (@MyClass) and put you *.mlapp and separate function in M-File in it.
Here is an example :
All M-Files are methods of my class VIDEOO.

댓글 수: 4

Oo that's somethink, thanks.
Another question, is it possilbe to add to this @VIDEOO folder a subfolders? because my program has this structure:
Never tried to add sub-folders in a class folder, I'm not sure it is supported by Matlab, can you try and tell me if it went well ?
You can however create a subfolder private where all functions in it will be private methods.
The problem is that the main program has defined myclass @engineSim, if i define new class (for app designer), the whole program doesn't work. Unfortunetly i don't have much experience with matlab.
Ok, now I'm not so sure of what you want to do. Does the entry point of your soft is the constructor of your class engineSim ? When do you call your *.mlapp file ?
If by "use several .m files in app designer code view" you mean define function in separate M-File, you can just create a function in a M-File and call it in any callback of your app (code view)

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

카테고리

도움말 센터File Exchange에서 Develop Apps Using App Designer에 대해 자세히 알아보기

제품

릴리스

R2019a

태그

질문:

2020년 7월 23일

댓글:

2020년 7월 24일

Community Treasure Hunt

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

Start Hunting!

Translated by