Can i use a class file which is created outside the app designer code window?
조회 수: 9 (최근 30일)
이전 댓글 표시
Hello Community,
I am trying to develope a post processing tool for 2D representation of ADAS test functions simulated in Simulink.
Is it possible to get the class files from outside the code block window in app designer or is it advisable to define the classes in the app designer itself.
and for the app to process data and display a 2D video. is it absolutely necessary to put all the required data's inside a single object for appdesigner to access matlab workspace and utilize it for the post processing.
Kindly let me know if my questions are clear. if it is not clear i will try to explain briefly in comments if required.
댓글 수: 0
답변 (1개)
Eric Delgado
2024년 2월 18일
Hey... notice that the AppDesigner code you're editing is a class. And then, you can't define a class directly within the code of another one.
Another point: it's important that you try to separate the front-end from the back-end, so it might be important for you to create classes outside of AppDesigner - using classdef - and create instances of it inside the app. To not lose the reference, you create a property in AppDesigner and store a handle to your object.
Finnaly, an app has its own workspace - its properties! If you're reading an external file to then do post-processing and plots, I suggest you store everything in the app's properties. If this is the case, you can open external file directily your app, using uigetfiles and related functions (readtable, fileread and so on).
% Outside AppDesigner (save as .m file)
classdef myClass
properties
classProperty
end
end
% Inside AppDesigner (.mlapp file)
properties (Access = private)
myObj = myClass
end
댓글 수: 1
참고 항목
카테고리
Help Center 및 File Exchange에서 Develop Apps Using App Designer에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!