Clear Filters
Clear Filters

Problem with compiling simscape library

2 views (last 30 days)
Rafal Marcinek
Rafal Marcinek on 5 Apr 2022
Answered: Shreshth on 11 Jan 2024
Hello, i have a problem with compiling simscape library using ssc_build function. Everything was working fine, but someday, when I was adding new component to existing library, i got an error:
Failed to generate 'subsea_lib'
Caused by:
Error using feval
Unrecognized function or variable 'subsea.lines.ss_nonlin_chamber'.
Code in the component is okay. When I paste this code into a component that was in the library before this problem occured, it compiles and works fine. I've tried to make simpliest compontents and try to compile them, but as soon as I make a new component out of this, there is same error. When I copy code to previously existing block, it works fine. Also when im copying working block, and saving it as a different component, same error appear. Did anybody had a problem like this?

Answers (1)

Shreshth
Shreshth on 11 Jan 2024
Hello Rafal ,
I could see that you are trying to work your way through compiling a Simscape library with addition of new components using the ‘ssc_build’ function.
Assuming that the code you have written is correct, there can be a few reasons due to which the compiler is throwing this error as mentioned below:
1.Check the MATLAB Path: Ensure that the folder containing the new component is on the MATLAB path. If MATLAB cannot find the component's file, it will not be able to compile it.
2.Verify File and Folder Names: Make sure that the file name and function name inside the component match exactly, including case sensitivity. MATLAB is case-sensitive on some platforms.
3.Check for Name Conflicts: Make sure there are no other functions or variables in your MATLAB workspace or on the MATLAB path with the same name as your component.
4.Check for Syntax Errors: Even though you mentioned the code works fine when pasted into an existing component, double-check for any syntax errors or missing files.
I am sure that checking the above probable reasons will resolve your issue. If not you can also try restarting MATLAB to clear any cached data that might be causing conflict.
Hope it helps.
Thank you,
Shubham Shreshth.

Categories

Find more on MATLAB in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!