Updating the scenario in Simulink

1 vue (au cours des 30 derniers jours)
OMAR HASSANIN
OMAR HASSANIN le 20 Oct 2019
I'm working on Adaptive Cruise Control (ACC) in Automated Driving Applications and i'm trying to evalutate the algorithim in different scenarios.
There're 2 variables, the global variables and the bus variables, both of them appear in the base workspace before i run the simulation and i've ScenarioReader block in my model reads the bus variables from .mat file in my working directory,and i generate the global variables easy in matlab and modify it when i want, and for the first time running the model, my model reads the bus file which is the scenario in my working directory and generate the global variables and the simulation works really good.
My problem happens when i want to update the bus file which has the trajectories of the cars in the second run, it doesn't get updated, but the global variable get updated in the workspace, and when i simulate model for the second time, i get the same trajectories for the cars but global variables get changed so i get wrong results.
I means by global variables are the variables used in other blocks in the model.
I searched for this problem before and what i understood is that simulink in the first run, it compiles the scenario and then put it in the memory as a cache also generate cache files in the working directory to make the simulation more faster in the next runs.
I solved it by closing the matlab and change the scenario and generate the global variables and run the simulation for the first time and it gets upated, but this solution is really bad and i need more automatic solution, and also if i want to update it again, i've to close the matlab again.
I tried to use clear and pack but it doesn't solve the problem, so please May you help me ?

Réponses (0)

Community Treasure Hunt

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

Start Hunting!

Translated by