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.

 采纳的回答

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

5 个评论

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
Hmm, you need to operate that within Simulink itself, in the simulation.
Ok, try something and ask specific questions. I am here.
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 Exchange 中查找有关 Modeling 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by