Overwrite exisiting simulink file using script
Afficher commentaires plus anciens
Hello all,
I am trying to create a simulink file using matlab script with the commands new_system() and save_system(). Unfortunately, this command is unable to overwrite if a file with the same name already exists. I have no problem overwriting the existing files.
Can anyone suggest a way where I can do this?
Réponse acceptée
Plus de réponses (1)
Rishi
le 30 Déc 2023
0 votes
Hey Harish,
I understand that you want to use the 'new_system' function to create a new Simulink model and then save that model using the 'save_system' function.
The function 'new_system' creates a new Simulink model in the memory. It works even if a model with the same name exists, but will throw a warning saying that your model is shadowing another model. Once you use 'save_system' on the new model, it overwrites the older model.
If you are unable to create a new model with the same name, the older model might be open. You can close that model first using the 'close_system' command.
You can learn more about 'new_system', 'save_system' and 'close_system' from the below documentations:
Hope this helps!
1 commentaire
Harish
le 4 Jan 2024
Catégories
En savoir plus sur Programmatic Model Editing dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!