フィルターのクリア

Can i use a class file which is created outside the app designer code window?

9 ビュー (過去 30 日間)
Ram Prasanth
Ram Prasanth 2024 年 2 月 15 日
コメント済み: Ram Prasanth 2024 年 2 月 19 日
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.

回答 (1 件)

Eric Delgado
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

カテゴリ

Help Center および File ExchangeDevelop 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