plot values from Numeric Edit Field into UIAxes tool

Hi everybody,
I want to generate a p-h Diagram using UIAxes tool in app Designer. For that end, I want to take the values from the Numeric Edit Fields tool (which are displaying the enthalpy and pressure during the simulation) and plot them with UIAxes during the suímulation.
However, I am having problems to generate the code in 'Code View' in my app.
Can anyone give me some help with that?
Thanks in advance!!
Mauricio

댓글 수: 6

How are you trying to generate the code?
Please share your current code.
Hi Cris,
Thanks for your fast reply. Here I am attaching the code that I am using in my app.
Basically I am working on the "function ONButtonPushed(app, event)".
But also I was trying some different way to call the live data in the section "function UIAxesButtonDown(app, event)". With the last one, any error appears during the simulation, but any point appears in the plot.
I will appreciate your detail comments because I am beginner with App designer.
Regards,
What is or isn't working? What is the behavior you want to change?
By the way, your set commands (lines 147-150) are unnecessary. You can remove them.
Hi Cris,
I was running the model eliminating the lines 147-150 and app is running without any error messages.
However, in the dashboard, the points that represent each sensor in my model are not appearing during the simulation. I also connect my simulink model with the P-H diagram block and it shows the P-H diagram correctly during the simulation, but the plot in the dashboard is empty (just appears the contours of the P-H diagram). I am attaching two images: ones is the dashboard and the other one is the P-H diagram block at the same moment in the simulation.
So, I am not sure which is the reason of that. Is the app not taking the live data from the simulink model during the simulation and that is why the plot in the dashboard is not plotting anything? or maybe could be another thing that is missing in my code?
Regards,
Hi Cris,
At the end I could get the points in the dashboard plot. I just need to put the code in the correct callback ('UIAxesButtonDown') and then it works (see the attached figure).
However, something that I noted is that to update the plot in the dashboard, I have to make double click in the plot, otherwise it does not update by itself while the simulation is running. Do you know what could be happening?
Also, I want to put a line which connects the points in the plot during the simulation. Do you know how to do that in my code?
Regards,
I could solve the issue related with the line connecting the points in the plot.
However, the problem with the plot updating in the dashboard still there.
Regards,

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

답변 (0개)

카테고리

도움말 센터File Exchange에서 Control Simulations with Interactive Dashboards에 대해 자세히 알아보기

질문:

2021년 8월 2일

댓글:

2021년 8월 3일

Community Treasure Hunt

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

Start Hunting!

Translated by