How to change globaly "Sample Time" to milliseconds?

8 views (last 30 days)
MATLAB by default "Sample Time" measures in seconds! How do I change globaly "Sample Time" to milliseconds?

Answers (1)

Paul
Paul on 29 Apr 2023
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 Mathematics in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!