Using an external script/function in simulink "matlab function block"

Hi,
i'm designing a simulation in simulink envolving thermodynamics.
I'm trying to find a way to insert a block which recieves a temperature and return a Linearly interpolated value of another parameter (density for instance) from an csv file.
I was trying to load the csv file as collumn vectors and it works fine outside the simulink function block. But trying to use the custom script inside the function block results always in errors.
is there any way to solve it or maybe an easier way to interpolate the values?
bear in mind that the input values change from iteration to iteration so this is why I need to interpolate it frequentlyy.
Many Thanks,
Netanel Sandman

 採用された回答

Jon
Jon 2020 年 11 月 16 日

0 投票

Will the 1-D interpolation block do what you need?

2 件のコメント

Netanel Sandman
Netanel Sandman 2020 年 11 月 16 日
Wow.....Thanks :)
Can't Believe I've Spent 2 days trying to work around a problem that has a built in Block....
I really need to start exploring the different blocks available.
Jon
Jon 2020 年 11 月 16 日
Good news. Glad to hear that solves your problem.

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

その他の回答 (0 件)

カテゴリ

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

質問済み:

2020 年 11 月 16 日

コメント済み:

Jon
2020 年 11 月 16 日

Community Treasure Hunt

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

Start Hunting!

Translated by