Model cannot be loaded because its name is the same as another model that is already loaded and has different full path
Mostrar comentarios más antiguos
Hi,
I am writing two programs. In the middle of each program, I need to get the output from a simulink model. I did this by adding this code:
sim('dir1/modelA.mdl')
to both programs and save them as 'dir2/file1.m' and 'dir3/file2.m'. The 1st program works fine. However, when I tried to run the 2nd program, I got this error:
Model 'modelA' with full path '*dir3*\modelA.mdl' cannot be loaded because its name is the same as another model that is already loaded and has different full path '*dir2*\modelA.mdl'. Please rename one of the models and try again.
I need to close and reopen Matlab before I can run the second file ('clear all' did not work). I don't want to create a duplicate of modelA and give it a different name. Is there any better way to solve this problem?
Thank you.
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Simulink en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!