How to save custom Simscape blocks?
조회 수: 7 (최근 30일)
이전 댓글 표시
Based upon a suggestion I got on this forum, I modified the Matlab code of a convective heat transfer block with the aim to create a custom Simscape block. But how do I save this as a Simscape block that I can use? According to instructions here and here, I did the following:
I made sure that I was working in a directory that is on the MATLAB path.
In this directory I created a subdirectory +Fridge, and saved the modified MATLAB code of the convective heat transfer block in this directory as varconvection.m
Then, from the parent directory of +Fridge, I ran the command ssc_build Fridge ....
Only thing that happens is that I get an error message: Generating Simulink library 'Fridge_lib' in the current directory 'D:\wvandervegte\SURFdrive\FALCON\Simulations' ... Warning: Not generating Simulink library 'Fridge_lib' as the MATLAB package 'Fridge' is empty and does not contain any MATLAB files (.m) or Simscape model files (.ssc).
However there is a .m file in this directory, namely varconvection.m
What am I doing wrong???
Any help greatly appreciated.
댓글 수: 0
채택된 답변
Sebastian Castro
2017년 5월 12일
Assuming your code is correct, all you have to do is change the extension of varconvection.m to varconvection.ssc.
Simscape source files use the .ssc extension, so ssc_build wasn't seeing one of those in your package folder.
- Sebastian
추가 답변 (0개)
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!