How to change the interpolation method of timeseries inside Simulink?

2 ビュー (過去 30 日間)
Luis Ruiz
Luis Ruiz 2018 年 9 月 10 日
編集済み: Luis Ruiz 2018 年 9 月 10 日
I have a timeseries object, and I am defining the interpolation method to be cubic Hermitian:
hermitian_interp_s = @( newtime, oldtime, olddata ) ...
interp1( oldtime, olddata, newtime, 'pchip', 8 );
vector_ts = setinterpmethod( vector_ts, hermitian_interp_s );
In code, an m. file, this works fine. Now I am saving this timeseries to be used in Simulink:
data_struct = struct( 'vector_ts', vector_ts );
save 'timeseries_data' 'data_struct' -v7.3;
bus_object = Simulink.Bus.createObject( data_struct );
And then I load it inside Simulink with a From File block. This block doesn't load the interpolation method defined for the timeseries that I created, it only supports linear and zero order.
So my question is, is there a way to make Simulink hold the interpolation method defined for the timeseries object?
I know it is not working because in the interpolation method I am defining that extrapolated values will get '8' all the time. In code that can be verified with:
vector_ts_2 = resample( vector_ts, new_time_vector );
vector_ts_2 uses the interpolation method defined by setinterpmethod, but not the From File block in Simulink.

回答 (0 件)

カテゴリ

Help Center および File ExchangeTime Series についてさらに検索

製品


リリース

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by