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?

 Respuesta aceptada

MathWorks Support Team
MathWorks Support Team el 30 de Sept. de 2019
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".

Más respuestas (0)

Categorías

Productos

Versión

R2018a

Etiquetas

Aún no se han introducido etiquetas.

Community Treasure Hunt

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

Start Hunting!

Translated by