how to include my own matlab functions in simulink

2 ビュー (過去 30 日間)
Constantine
Constantine 2014 年 7 月 12 日
コメント済み: Azzi Abdelmalek 2014 年 7 月 12 日
Am using 2013A. Am new to Simulink. I want to include Matlab functions I've already written. Simulink lets me create a user-defined Matlab function block (User-defined functions, Matlab function fcn()
which does create a new blank function that I can edit. But what I want to do is open my existing matlab stuff and use it as a simulink object. The only thing I can think of is to copy and paste my matlab function into the blank template for the fcn() object created by Simulink but this is unbelievably klugey. Any ideas??

回答 (1 件)

Azzi Abdelmalek
Azzi Abdelmalek 2014 年 7 月 12 日
  2 件のコメント
Constantine
Constantine 2014 年 7 月 12 日
I tried this - just opens up a block where I can call a matlab function (sin is the default). So then I can put my own function name there? That's OK except this restricts me to only returning a single value. Is this something I just have to accept?
Azzi Abdelmalek
Azzi Abdelmalek 2014 年 7 月 12 日
No, you can return what you want, and choose your own function

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

カテゴリ

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

製品

Community Treasure Hunt

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

Start Hunting!

Translated by