I want to display the changes of the curves in the Simulink model in real-time in the APP designer.
조회 수: 2 (최근 30일)
이전 댓글 표시
I want to display the changes of the curves in the Simulink model in real-time in the APP designer. In other words, I want to see the process of curve changes, but now I can only see the final result of the curve.
First,I display the result with codes below,but i want to show the process of changes real-time.
simInp = Simulink.SimulationInput('PC_Muti_Volume_platform_PB1_PB2');
simOut = sim(simInp);
load P_real.mat;
load P_set.mat;
plot(app.UIAxes_6,P_real.time,P_real.data,P_set.time,P_set.data);
The result is like this , how can I make it show the changes.

댓글 수: 0
답변 (1개)
Rahul
2025년 3월 20일
As I understand you wish to demonstrate the output of your Simulink model in App Designer in real-time. You can consider using Simulink real-time components. MATLAB R2022a has som Simulink real-time components availble in the Component Library of App Designer. In order to use more Simulink real-time components, consider upgrading to recent MATLAB releases.
Refer to the following MathWorks documentations to know more about Simulink real-time components:
https://www.mathworks.com/help/slrealtime/ug/basic-app-designer-app-for-real-time-app-interface.html
Another approach can be to use Simulink real-time App generator. This has capabilities to create an App Designer app, which would work with specified Simulink model and can be accessed from the Simulink editor from the Real-time tab.
Refer to the following documentations to know more about this:
The following MATLAB Answers mention another approach where the InitFcn and StartFcn of the Simulink model can be changed. A callback for updating the GUI of the app can be called.
Hope this helps! Thanks.
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Model Preparation에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!