problem with ssc_build to generate custom simscape library
이전 댓글 표시
Hi everyone, I am trying to learn how to make custom simscape blocks.I have written ssc file,and created a new directory (named +gear_
pump) that I added to my Matlab path.Then, I run the ssc_build command to generate my custom library. When run the ssc_build command I get the following error message:
Generating Simulink library 'gear_pump_lib' in the MATLAB package parent directory 'D:\matlab\simscape\' ...
Failed to generate 'gear_pump_lib'
原因:
错误使用 feval
函数或变量 'gear_pump.gear_pump' 无法识别。
(translate in English :
reason:
Incorrect use of festival
Function or variable 'gear'_ pump.gear_ The 'pump' is not recognized)

댓글 수: 9
Yifeng Tang
2023년 4월 28일
Is it possible to share the .ssc file you try to build the library from? It feels like some syntax error in the .ssc file but it would be difficult to identify without the .ssc file itself.
轩 贾
2023년 5월 4일
Yifeng Tang
2023년 5월 4일
It was able to compile OK on my end, strangely. Just used ssc_build('custom_library') and it generated a custom library. I did need to modify two lines of code later to make the simulation run (has to do with how 'rad' unit is interpreted), but the compiling was OK. The results also seem to make sense.

What version of MATLAB are you using? I can try again in the same version and share the files.
轩 贾
2023년 5월 5일
轩 贾
2023년 5월 5일
Yifeng Tang
2023년 5월 5일
啊,我明白问题出在哪里了 ... 看Answer部分。
轩 贾
2023년 5월 5일
Yifeng Tang
2023년 5월 5일
在 +dirname 的上一级目录执行 ssc_build('dirname')
轩 贾
2023년 5월 6일
채택된 답변
추가 답변 (1개)
ms z
2024년 8월 26일
0 개 추천
你好,我遇到了同样的问题,也是在使用ssc_build的时候报错函数或变量无法识别,请问您是怎么解决的,能否指点一下,谢谢
댓글 수: 1
Yifeng Tang
2024년 8월 26일
If you used a MATLAB function in your equations session of the .ssc code, the function has to be one on this list: https://www.mathworks.com/help/simscape/lang/equations.html#brtts6o
If you don't think that's the issue, consider ask in a new question and provide more details.
카테고리
도움말 센터 및 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!

