How can I write an initialization values in simulink?

I'd like to write some values that are initialized once in the beginning in the program. The system is closed loop and there are equations depend on itself Ex.:
a= w*e+b;
b=f/a;
so we must write at the first, the values of ( w, e, and f) then the system will use the values which are being extracted from the simulink.

 採用された回答

Birdman
Birdman 2018 年 3 月 28 日

0 投票

You should write them to File->Model Properties->Model Properties->Callbacks->InitFcn.

5 件のコメント

Ahmed Sayed
Ahmed Sayed 2018 年 3 月 30 日
I tried this before, but the problem is the simulink does not calculate the equations by using the new values, which are being extracted from the simulink
Birdman
Birdman 2018 年 3 月 30 日
Hmm, you need to operate that within Simulink itself, in the simulation.
Ahmed Sayed
Ahmed Sayed 2018 年 4 月 2 日
yes, that is what I need.
Birdman
Birdman 2018 年 4 月 2 日
Ok, try something and ask specific questions. I am here.
Ahmed Sayed
Ahmed Sayed 2018 年 4 月 2 日
Now the problem is: the simulink ran without any error, but it still does not use the new values, which are being extracted from the simulink

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

その他の回答 (0 件)

カテゴリ

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

質問済み:

2018 年 3 月 27 日

コメント済み:

2018 年 4 月 2 日

Community Treasure Hunt

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

Start Hunting!

Translated by