Problems with adding block from target link into a model
11 次查看(过去 30 天)
显示 更早的评论
Hi
I’m trying to add a block from the library TargetLink with the command: "add_block('tllib/Constant','mysys/nameofconstant','Position',[]).
But Matlab answers with:"??? Error using ==> add_block There is no block named 'tllib/Constant'.".
But if there already exist a model in the same folder containing a TargetLink block, then Matlab has no problem executing the command.
Do anyone have a idea how to fix this problem or how to make a work around.
//Patrik
0 个评论
采纳的回答
Arnaud Miege
2011-6-16
You maybe need to load the library before using add_block:
load_system('tllib');
add_block('tllib/Constant','mysys/nameofconstant','Position',[]);
HTH,
Arnaud
0 个评论
更多回答(2 个)
Fangjun Jiang
2011-6-16
Yep, this happens. What you need to do is to make sure that 'tllib' is loaded first. You can use load_system('tllib');
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Configure and View Diagnostics 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!