problem with ssc_build to generate custom simscape library
Afficher commentaires plus anciens
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 commentaires
Yifeng Tang
le 28 Avr 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.
轩 贾
le 4 Mai 2023
Yifeng Tang
le 4 Mai 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.
轩 贾
le 5 Mai 2023
轩 贾
le 5 Mai 2023
Yifeng Tang
le 5 Mai 2023
啊,我明白问题出在哪里了 ... 看Answer部分。
轩 贾
le 5 Mai 2023
Yifeng Tang
le 5 Mai 2023
在 +dirname 的上一级目录执行 ssc_build('dirname')
轩 贾
le 6 Mai 2023
Réponse acceptée
Plus de réponses (1)
ms z
le 26 Août 2024
0 votes
你好,我遇到了同样的问题,也是在使用ssc_build的时候报错函数或变量无法识别,请问您是怎么解决的,能否指点一下,谢谢
1 commentaire
Yifeng Tang
le 26 Août 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.
Catégories
En savoir plus sur Upgrading Hydraulic Models to Use Isothermal Liquid Blocks dans Centre d'aide et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

