Invalid Simulink object name

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.

在这里插入图片描述
空格会造成运行出错。

For a useful introduction that will help you start using Simulink quickly, take a look at “Running a Demo Model” in Chapter 2. Browse around the model, double-click on blocks that look interesting, and you will quickly get a sense of how Simulink works. If you want a quick lesson in building a model, see “Building a Simple Model” in Chapter 2. Chapter 3 describes in detail how to build and edit a model. It also discusses how to save and print a model and provides some useful tips. Chapter 4 describes how Simulink performs a simulation. It covers simulation parameters and the integration solvers used for simulation, including some of the strengths and weaknesses of each solver that should help you choose the appropriate solver for your problem. It also discusses multirate and hybrid systems. Chapter 5 discusses Simulink and MATLAB features useful for viewing and analyzing simulation results. Chapter 6 discusses methods for creating your own blocks and using masks to customize their appearance and use. Chapter 7 describes subsystems whose execution depends on triggering signals. Chapter 8 provides reference information for all Simulink blocks. Chapter 9 provides information about how Simulink works, including information about zero crossings, algebraic loops, and discrete and hybrid systems. Chapter 10 provides reference information for commands you can use to create and modify a model from the MATLAB command window or from an M-file. Chapter 11 explains how to use the Simulink debugger to debug Simulink models. It also documents debugger commands. Appendix A lists model and block parameters. This information is useful with the get_param and set_param commands, described in Chapter 10. Appendix B describes the format of the file that stores model information. Although we have tried to provide the most complete and up-to-date information in this manual, some information may have changed after it was completed. Please check the Known Software and Documentation Problems delivered with your Simulink system, for the latest release notes.
评论 6
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值