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.

 Accepted Answer

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

5 Comments

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.
yes, that is what I need.
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

Sign in to comment.

More Answers (0)

Categories

Find more on Modeling in Help Center and File Exchange

Asked:

on 27 Mar 2018

Commented:

on 2 Apr 2018

Community Treasure Hunt

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

Start Hunting!