add_block('powertrainlib/Powertrain','Generator_to_Electric_Motor/Powertrain’);
1 次查看(过去 30 天)
显示 更早的评论
add_block('powertrainlib/Powertrain','Generator_to_Electric_Motor/Powertrain’);
Error due to multiple causes.
Caused by:
Unable to load block diagram 'powertrainlib'
There is no block named 'powertrainlib/Powertrain'
how to fix this?
0 个评论
回答(1 个)
Fangjun Jiang
2024-1-5
The full path of the source block is incorrect. The best way to handle this, is to do it manually.
If you are able to open the powertrain library manully, then select the block you want to add, go to MATLAB Command Window, type 'gcb'. It will show you the correct path of the block. Then you can use it in the add_block(). For example:
>> gcb
ans =
'autolibmotorctrlr/Interior PM Controller'
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Automotive Applications 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!