How to change the dashboard x axis

6 visualizzazioni (ultimi 30 giorni)
Ajay Krishna Vasanthakumar
Commentato: Abhishek il 20 Giu 2025
I want the Dashboard x axis based on other signal at current time step. how can i do this

Risposte (1)

Abhishek
Abhishek il 16 Giu 2025
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 Commenti
Abhishek
Abhishek il 19 Giu 2025
Hi @Ajay Krishna Vasanthakumar, glad I could help. Can you please specify the problem properly?
Abhishek
Abhishek il 20 Giu 2025
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.

Accedi per commentare.

Prodotti


Release

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by