필터 지우기
필터 지우기

Reset Initial Conditions of level 1 S-function states

조회 수: 1 (최근 30일)
Remus
Remus 2015년 6월 16일
답변: Andrew Schenk 2015년 6월 17일
Hello.
Is it possible to reset the initial conditions of the states of a continuous time level-1 s-fun? Usually the states I.C. are set by mdlInitializeSizes() function call at the beginning of the simulation. But what if in the middle of the sim I want to reset the IC?
Thanks.

답변 (1개)

Andrew Schenk
Andrew Schenk 2015년 6월 17일
There are two ways to do this. You can either:
  1. Add an extra input to the S-function and write a conditional statement to reset the states when the extra input value changes.
  2. Place the S-function inside of an enabled / triggered subsystem and set the "Output when disabled" to "reset" - this will call mdlInitialize every time the subsystem is disabled.

카테고리

Help CenterFile Exchange에서 Block and Blockset Authoring에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by