datatypes supported by simulink
1 次查看(过去 30 天)
显示 更早的评论
Hi everybody...I am a few steps away from fulfilling my design concerning calling functions to matlab function block....but I stumbled in defining the datatypes of the function adaptfilt.lms I don't know how to define this function beacause when using class(h) where h=adaptfilt.lms, the answer is :adaptfilt.lms which is completely invalid if anyone know that simulink does not support such function type please tell my to stop my pointless trials and turn to another way..thanks alot.
2 个评论
Kaustubha Govind
2012-2-14
Ahmed: This question seems similar to the one already answered at http://www.mathworks.com/matlabcentral/answers/28745-matlab-simulink-supported-data-types - perhaps you should provide a snippet of your code or explain your question better if the previous answer didn't help you.
回答(1 个)
Walter Roberson
2012-2-14
Stop your pointless trials and turn to another way. ;-)
You will not be able to pass objects of arbitrary classes as parameters in Simulink, as best I can tell. The problem is not the dot; the problem is that the class is not one of the ones already defined for Simulink to be able to pass around.
You should consider whether it is really necessary to pass the entire adaptive filter object around. Is it not enough in your situation to construct it and use it all inside the MATLAB Function Block? If the adaptive filter is needed in several places, is it important that it be the same adaptive filter object each time, or would it be permitted to pass the construction parameters around and build it each time it was needed?
If it is important that it be the same filter object each time, then consider defining it in a MATLAB function and using "persistent" to hold on to its value in that function; then when the other locations need it, they could call the same routine with parameters indicating that they want to retrieve the object.
If you need several different adaptive filter objects simultaneously then you could use a variation of the above except that the routine returns an "id" (which could be as simple as an index in to an array) and the retrieving routine passes in the ID to indicate which particular object it needs to retrieve.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Adaptive Filters 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!