MATLAB Examples

Create a Realistic Dashboard Using the Custom Gauge Block

You can use the Custom Gauge block to create a dashboard of controls and indicators for your model that looks how it would in a real system.

Contents

Model Overview

This example model uses four Custom Gauge blocks and a MultiStateImage block to create a dashboard for the sf_car model like one you might see in a real car.

Explore the Model

To understand the connections between the Dashboard and model, you can select each block and jump to the signal it displays in the model. To jump to the connected signal, hover on the ellipsis that appears over the block when you select it. Then, click the arrow button.

The Custom Gauge block on the left represents the vehicle speed signal, acting as a speedometer on the dashboard and using the default Custom Gauge appearance and a value arc you can see when you simulate the model.

The Custom Gauge blocks at the top of the model display the throttle and brake signals. You can create this type of gauge by deleting the background image and needle image from the default Custom Gauge. Then, draw an arc and select colors for the tick marks, arc, and value arc.

The Custom Gauge block on the right displays the engine RPM signal on a custom gauge face. You can create a gauge like this by deleting the background image in the default Custom Gauge and uploading your own.

The MultiStateImage block on the bottom displays the gear signal using seven segment display style number images that correspond to the value of the gear signal.

Observe System During Simulation

You can use the dashboard to monitor the system response during simulation. The User Inputs subsystem includes several simulation inputs to model different vehicle maneuvers. To change the simulation input, navigate to the top level of the model and double-click the User Inputs subsystem. You can use the drop-down menu at the top of the gui to choose the vehicle action for the model to simulate. Choose between a passing maneuver, gradual acceleration, hard braking, and coasting. To monitor the system response during simulation, navigate back to the Dashboard subsystem and then press the play button to simulate the model.