Current sum of a variable in S-Function Builder
    9 Ansichten (letzte 30 Tage)
  
       Ältere Kommentare anzeigen
    
Hello!
I want to calculate the current value of a variable which increases and decreases depending on some conditions. I am using the S-Function Builder, but I want to initialise this variable only at the beginning of the simulation (only once and NOT every time the C-Script runs). How can I do that?
Thank you in advance!
0 Kommentare
Antworten (2)
  Diya Tulshan
      
 am 18 Jul. 2023
        
      Bearbeitet: Diya Tulshan
      
 am 18 Jul. 2023
  
      Hii Magdalini,
I understand that you want to initialise the value only once  and to be precise in the beginning in the stimulation.
I have attached a new links for reference which will help to achieve the result:-
Hope this helps!
0 Kommentare
  Hua Bai
    
 am 19 Okt. 2023
        Maybe you can try to use the discrete state with initial condiciton, and update the discrete state in update method.
0 Kommentare
Siehe auch
Kategorien
				Mehr zu Migrate GUIDE Apps finden Sie in Help Center und File Exchange
			
	Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!