How to rectify 'undefined function or variable'. errors. in code generation
1 view (last 30 days)
Show older comments
I am currently working on a svm project. I have created my model and it's working well. I tried to generate the C code for the model using 'learnerCoderConfigurer' and 'saveCompactModel' but I'm getting errors 'undefined function or variable'. Attached is a copy of my code.
2 Comments
Adam Danz
on 30 Nov 2018
Your question is impossible for us to answer without more infomration.
The error your getting means exactly what it states: you have a variable or a function in your code that is undefined.
You're loading variables (and/or functions) at the beginning of your code and we can't see what you're loading so there's no way for us to know what is undefined in your code.
Fortunately, matlab also tells you the line of your code that is causing the problem and it even tells you the exact item that is undefined. However, you haven't shared that information with us.
If you provide the full error message that would be a good start.
Answers (1)
Adam Danz
on 30 Nov 2018
In your attached sample of code, given the error message, "saveCompactModel" seems to be a function and matlab doesn't have access to it.
The same is probably true for the learnerCoderConfigurer function.
0 Comments
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!