bdroot command results wrong model name. Instead of showing loaded model name it is showing "simulink" in matlab 2016b, windows11

7 次查看(过去 30 天)
I am trying to save model using command "savesystem". In savesystem script, there is a command i_builtin(bdroot); to get loaded model. but here, bdroot is returing, "simulnk" instead of loaded model name. Here i am using matlab 2016b on windows11

回答(1 个)

Dinesh
Dinesh 2023-11-17
Hi Siva Prasad.
I tried to reproduce your issue in R2016b.
When I open MATLAB and type "bdroot" in the MATLAB Command window, I get an empty "char" array as the result. When I create a new model (not saved yet) and now type "bdroot" in the command window, I get "untitled". Now, when I close the model and type "bdroot", I get "simulink". This suggests that your model might not be loaded properly or that there is no model window open.
If you have already saved your model before, then load it using the "load_system" function whose argument is the model name. Now if you type "bdroot", you should see the model name as the result.
Once you have the model name as the result and have made new changes to the model, you can save it using the following command:
>> save_system(bdroot)

类别

Help CenterFile Exchange 中查找有关 Programmatic Model Editing 的更多信息

产品


版本

R2016b

Community Treasure Hunt

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

Start Hunting!

Translated by