problem with ssc_build to generate custom simscape library
Mostrar comentarios más antiguos
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 comentarios
Yifeng Tang
el 28 de Abr. de 2023
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.
轩 贾
el 4 de Mayo de 2023
Yifeng Tang
el 4 de Mayo de 2023
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.
轩 贾
el 5 de Mayo de 2023
轩 贾
el 5 de Mayo de 2023
Yifeng Tang
el 5 de Mayo de 2023
啊,我明白问题出在哪里了 ... 看Answer部分。
轩 贾
el 5 de Mayo de 2023
Yifeng Tang
el 5 de Mayo de 2023
在 +dirname 的上一级目录执行 ssc_build('dirname')
轩 贾
el 6 de Mayo de 2023
Respuesta aceptada
Más respuestas (1)
ms z
el 26 de Ag. de 2024
0 votos
你好,我遇到了同样的问题,也是在使用ssc_build的时候报错函数或变量无法识别,请问您是怎么解决的,能否指点一下,谢谢
1 comentario
Yifeng Tang
el 26 de Ag. de 2024
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.
Categorías
Más información sobre Upgrading Hydraulic Models to Use Isothermal Liquid Blocks en Centro de ayuda y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

