Did you ever get an error like this?
get_param('model_f14/Controller','TreatAsAtomicUnit')
Invalid Simulink object name: model_f14/Controller.
Of course. Anytime you have a typo in a call to get_param or set_param, you will get this message. This is very frustrating, especially when you look at the model, and see the block with the very same name!
Invisible Characters!
To understand why this was happening, I had to compare the string I was using to the name of the block from using gcb (get current block).
s1 = 'model_f14/Controller'
s1 =
model_f14/Controller
s2 = gcb
s2 =
model_f14/Controller
strcmp(s1,s2)
ans =
0
The string from gcb looks the same, but then I noticed the size of the signals in the workspace.
空格会造成运行出错。