How to change globaly "Sample Time" to milliseconds?

MATLAB by default "Sample Time" measures in seconds! How do I change globaly "Sample Time" to milliseconds?

Answers (1)

In the Simulink model, you can make the stop time whatever is desired. The simplest way is to just replace the 20.0 with whatever value you want in the Stop Time box in the Simulate section of the ribbon.
If you're using a fixed step solver, you can specify the solver step size, which is also called the global sample time, on the solver pane if you don't want Simulink to choose for you (you can also specifcy the simulation stop time here): Model settings -> Solver. If using a variable step solver, you can specifiy max step size on the solver pane if you don't want Simulink to choose for you.

Categories

Find more on Simulink in Help Center and File Exchange

Asked:

on 28 Apr 2023

Answered:

on 29 Apr 2023

Community Treasure Hunt

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

Start Hunting!