How to change the dashboard x axis

조회 수: 7 (최근 30일)
Ajay Krishna Vasanthakumar
Ajay Krishna Vasanthakumar 2025년 6월 11일
댓글: Abhishek 2025년 6월 20일
I want the Dashboard x axis based on other signal at current time step. how can i do this
  댓글 수: 2
Walter Roberson
Walter Roberson 2025년 6월 11일
Ajay Krishna Vasanthakumar
Ajay Krishna Vasanthakumar 2025년 6월 19일
In Dashboard scope it is always signal vs Time

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

답변 (1개)

Abhishek
Abhishek 2025년 6월 16일
I understand that you are trying to configure the Dashboard Scope block in Simulink such that the X-axis is based on another signal (not simulation time).
Unfortunately, the Dashboard Scope block does not support customizing the X-axis. It is designed to display connected signals against simulation time only, and this behavior is not configurable.
If your use case requires plotting one signal against another during simulation (e.g., plotting y versus x, where both are time-varying signals), here are a few alternatives you can try:
  • Use the XY Graph Block: You can use the XY Graph block, which supports real-time plotting of one signal versus another during simulation. Simply connect your desired X-axis signal and Y-axis signal to this block. This block can be found under Simscape, then Utilities.
  • MATLAB Plot: Another option is to log both signals using the ‘To Workspace’ blocks and then use MATLAB to plot the results post-simulation with the following command:
plot(x_signal, y_signal)
  • Use Scope Block with Logging: You can use the standard Scope block to mark the signals for logging. After simulation, export the logged data to MATLAB and manually generate a custom XY plot.
I hope this helps.
  댓글 수: 3
Abhishek
Abhishek 2025년 6월 19일
Hi @Ajay Krishna Vasanthakumar, glad I could help. Can you please specify the problem properly?
Abhishek
Abhishek 2025년 6월 20일
Hi @Ajay Krishna Vasanthakumar, you can use the Selector block,by setting the index to 1, I was able to extract 'x[0]' and 'y[0]' (first element of the array signals, since Simulink uses 1-based indexing) and connect them to the XY Graph block. If you're plotting offline in MATLAB after simulation, you can use:
plot(x_signal(:,1), y_signal(:,1))
to get the same result.

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

카테고리

Help CenterFile Exchange에서 Scopes and Data Logging에 대해 자세히 알아보기

제품


릴리스

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by