Cannot Build Simscape Sublibraries
显示 更早的评论
Hi all, I'm learning to use the Simscape environment and create custom libraries. I've run into an error trying to create a package with subdirectories. Using the THyd example from https://www.mathworks.com/help/simscape/lang/working-with-domain-parameters.html, my folders are structured as follows with my Documents\MATLAB folder which I've added with addpath:
- +TestModels
|-- +THyd
| |-- t_hyd.ssc
| |-- hyd_temp.ssc
| |-- h_temp_sensor.ssc
| |-- h_temp_ref.ssc
however when I try to run ssc_build TestModels I'm met with the following error:
Error using ssc_build
Failed to generate 'TestModels_lib'
Caused by:
Simscape file with package path 'THyd.t_hyd' is not on MATLAB path and not in import context declared by import statements. Ensure
the Simscape file is on MATLAB path or in import context. If theSimscape file is moved or renamed, use its new package path.
• In TestModels.THyd.h_temp_ref (line 5)
where line 5 is the a = THyd.t_hyd node declaration. Removing +THyd from +TestModels and running ssc_build THyd works without issue. I can't seem to find record of this error anywhere else. Any thoughts on how to resolve the issue? I will be using the TestModels folder for future projects, so while just using THyd is fine for now I'm looking for a solution that allows subdirectories.
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Foundation and Custom Domains 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!