How do I automaticaly change values of blocks inside a reference model?
Mostra commenti meno recenti
Hello everybody
I am using a reference model and including several instances of it inside of another model. Each instance has initial conditions, "To workspace" blocks, constants, etc., which need to be different among each instance. For example:
Instance 1-> Initial conditions: X_ini(1,1:3), "To workspace" name: X_out_1
Instance 2-> Initial conditions: X_ini(2,1:3), "To workspace" name: X_out_2
where X_ini [2,3] would be a matrix with all the initial conditions and X_out_1 and X_out_2 would be the variables saved in the Workspace.
One possibility would be to add an input and output port, and set the initial conditions and save the data from outside. The problem with this solution is that I do not have only initial conditions and saved variables, but many other things. I would be cleaner and faster if every time I introduce a reference model, it automatically changes those values.
Does anybody know how to do it? Should I use a library block instead?
Thank you very much in advance, Pablo
Risposta accettata
Più risposte (0)
Categorie
Scopri di più su Event Functions in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!