Cannot load 'F:\MatLab​R2011beta\​toolbox\co​ntrol\cont​rol\@tf\tf​.m because code generation does not support classes and enumerations in @-directories

As the question shown above,when I use "tf" function in MatLab Functions, Simulink, Such error notification occurs. Could anyone give any suggestion in how to solve the problem? Many Thanks Best Regards Chai Xiaolei

 Accepted Answer

Even in the current release, R2017b, almost nothing in the Control System Toolbox can have code generated for it; https://www.mathworks.com/help/simulink/ug/functions-supported-for-code-generation-categorical-list.html#bvf1hfo. Only two functions dealing with Kalman filters, and one function for particleFilter.
In Simulink in that release, it might be possible to use tf() from an Interpreted MATLAB Function Block.
R2011a was the one in which Embedded MATLAB Function Block was renamed to MATLAB Function Block. If you were to use Acceleration Mode 'none' or 'normal' in a MATLAB Function Block, then you should be able to use coder.extern() [though I have not checked to see if it was available that long ago] to call into the control system toolbox. However, this is not possible in any higher acceleration mode and is not possible when deploying to target.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!