Initial conditions

Hi,
I use simulink 7.4(R2009b) and have a simulink model with several sub systems and I would like to define a few initial conditions to be used in several blocks. I don't want to define them either inside their corresponding blocks or in a M-file. How to define them in the first page of my simulink model so that I can change them simply before running the simulink model?
Thanks,

回答 (2 件)

Paulo Silva
Paulo Silva 2011 年 4 月 1 日

0 投票

Maybe something like the Model Info block but with your initial condition variables, you have to put the same variables inside the block parameters you want to change.
Mehrdad
Mehrdad 2011 年 4 月 13 日

0 投票

Thanks for your answer. It was helpful. I also found out that in "Model Properties" there is a place so called "Callbacks". We can define those initial values there in "Initfcn".
Bests, Mehrdad

1 件のコメント

Arnaud Miege
Arnaud Miege 2011 年 4 月 13 日
This is OK if you don't have much MATLAB code. If your model is relatively large and you have a lot of of initialization code, you'll find that it's more scalable and readable to use a MATLAB script. This will also allow you to re-use the script with a different model.

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

カテゴリ

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

質問済み:

2011 年 4 月 1 日

Community Treasure Hunt

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

Start Hunting!

Translated by