Paulo in MATLAB Answers
Última actividad el 3 de Feb. de 2023

Hello, I'm using a SimBiology exported model and I need to get the last value of a simulation and use it as initial condition for a following simulation (with different parameters, or dosing information), here is an example of what I need to do: [t, y, names] = simulate(exported_model); exported_model.InitialValues = y; [t, y, names] = simulate(exported_model); The problem is in the second line of the code as, surprinsingly, the order of the variables in y is not the same as the order in InitialValues. Currently, I'm performing a search for the appropriate index in names and using `exported_model.getIndex` to update each element of InitialValues. But this approach is suboptimal, it takes more than 1min to go over the entire array of initial conditions. Is there any way to ensure that the output of model simulations come in the correct order? Or what would be the optimal approach here? Thank you