MATLAB Answers

Eric Cope

Simulink Saving to Workspace Time is not monotonically increasing

Asked by Eric Cope
on 29 Jan 2013

I am running a simulink simulation using the fixed-step discrete solver. I've even specified the fixed-step size. I save some data via a "To Workspace" block (I've used the Scope to save to workspace as well with equivalent results). When I look at the time data in the object, the time is not monotonically increasing.

The time value is constant for 5-10 samples, then continues. Any ideas why this happens?

Thanks, Eric


The sample rate changes from 208MHz to 104MHz. Note that I received the same kind of data with or without the rate transition block.

Ryan G
on 5 Feb 2013

What is the sample time in that 1/z block? What is the sample time in the to workspace block? What is the save format in the to workspace block?

 If it is sampling faster than it is receiving data, it will repeat values in the data.  
on 7 Feb 2013

@Ryan G: Even if sampling is faster than update, data saved will be monotonically increasing although not strictly because of repeat values.

@Eric Cope: Do you mean monotonically increasing or strictly monotonically increasing? If you meant latter, its expected as Ryan explains. If its former, its intriguing - upload your model.



0 Answers

Join the 15-year community celebration.

Play games and win prizes!

Learn more
Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

MATLAB Academy

New to MATLAB?

Learn MATLAB today!