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?

 採用された回答

MathWorks Support Team
MathWorks Support Team 2019 年 9 月 30 日

0 投票

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".

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeEvent Functions についてさらに検索

製品

リリース

R2018a

タグ

タグが未入力です。

Community Treasure Hunt

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

Start Hunting!

Translated by