How to hold the extrapolated values using time series object

I am not able to hold the last known value of the data point between Simulation time?

 Accepted Answer

In order to hold the last value during simulation, the customer needs to use the setinterpmethod to "zero-order hold" in case of data import (either from excel file or to signal builder). The sample code for setInterpmethod is given below:
>> ts = timeseries(rand(100,1),1:100);
>> ts = setinterpmethod(ts,'zoh');
Save the above data in MAT file and use this to import data into the Signal builder. This will make sure that the last value is held in the plot during the sample time period.
Please note that when using a From Workspace block to get the timeseries data into Simulink, you will need to Turn-off the option "Interpolate Data".

More Answers (0)

Categories

Find more on View and Analyze Simulation Results in Help Center and File Exchange

Products

Release

R2018a

Tags

No tags entered yet.

Community Treasure Hunt

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

Start Hunting!