How to change the interpolation method of timeseries inside Simulink?
1 回表示 (過去 30 日間)
古いコメントを表示
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 件のコメント
回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Time Series についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!