How to include a spline interpolant in simulink as a function into a block?

2 ビュー (過去 30 日間)
Juan Urrego
Juan Urrego 2014 年 7 月 30 日
コメント済み: Juan Urrego 2014 年 8 月 5 日
Hello
I have 2 following arrays x=[0:0.01:0.25]; a= [1 1 1 1 0.995 0.977 0.965 0.958 0.957 0.955 0.951 0.96 0.978 0.979 0.98 0.982 0.984 0.986 0.988 0.99 0.992 0.994 0.996 0.998 0.998 0.998 ];
I need a function which depict the data as a signal in simulink into a block, but is not possible because the polynomial function doesn't fit perfectly with the data, so the function which is created by regression is no good for my work, then i made a spline interpolant and it is a good representation of the curve, but i don't know how to include it in simulink.
Thank you for attention

採用された回答

Jian Wei
Jian Wei 2014 年 7 月 30 日
1-D Lookup Table block in the Lookup Tables may be what you are looking for.
After you open the block parameters dialogue, under the Table and Breakpoints tab, you can put your sample points and their corresponding values to the Breakpoints and Table data, respectively. Under the Algorithm tab, you can choose the interpolation method as Cubic spline. In this way, you can generate a spline interpolation of the curve in Simulink.
  1 件のコメント
Juan Urrego
Juan Urrego 2014 年 8 月 5 日
Is it possible to use that interpolation as a element?, I mean for interact with it as same as a function does.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

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

製品

Community Treasure Hunt

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

Start Hunting!

Translated by