Connecting matlab output to simulink input. How to?

30 ビュー (過去 30 日間)
adi kul
adi kul 2015 年 4 月 2 日
コメント済み: adi kul 2015 年 4 月 3 日
Hi, Me and my friend were working on a project where I have developed pre part in matlab code and my friend has done his part in Simulink. Now I want to connect my output to his Simulink diagram's input port. Can anyone help me or guide me?
My output consists of 4 values, temperature, velocity, NH3 and NO concentrations which represents exhaust. While that output will be fed to his model as input where he created a model which will further optimize the output which is coming from my model.

採用された回答

Mahdiyar
Mahdiyar 2015 年 4 月 2 日
Hi kul
I think you need to:
1- use "From Workspace" in the simulink part. This blok helps you to take the value from the workspace. So you can put the name of your varaibles in this block.
2- use the matlab command "sim" at the end of your code to run the simulink. (check matlab help to know how to use it. It is simple)
3- Run your code.
Enjoy it :)
Regards
  1 件のコメント
adi kul
adi kul 2015 年 4 月 3 日
Hi, I am trying this solution but I can't get it work.
I have put in matlab code as
Simout=sim('Model',temp);
and in Simulink diagram in "from workspace" changed the parameter to temp
Still getting error there!

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

その他の回答 (1 件)

Azzi Abdelmalek
Azzi Abdelmalek 2015 年 4 月 2 日
You can use a Matlab function block

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by