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!

