coder.excentric not working when compiling with TwinCat Target
이전 댓글 표시
Hello,
I am working on a case where I put simulink generated code into an embedded PC. My model works fine in simulink, but when I try to generate the code for my embedded controller, it fails. The fault message is the following.
_Failed to eliminate a call to the MATLAB function 'butter'. For non-simulation builds, calls to unsupported MATLAB functions are eliminated if they do not affect function out puts. Function 'filter1/MATLAB Function' (#34.92.133), line 6, column 1: "[a,b] = butter(w,[x y]/(z/2), 'bandpass')"
I found out that the actual problem is that coder.extrinsic('butter') is not allowed by external compilers. But I really need a way to create a butterworth filter in a matlab function block.Because my system needs a filter with adaptable bandwith. Is there somebody who knows a possible workaround?
function [a,b] = fcn(w,x,y,z)
a=zeros(1,(11));
b=zeros(1,(11));
coder.extrinsic('butter');
[a,b] = butter(w,[x y]/(z/2), 'bandpass');
채택된 답변
추가 답변 (1개)
Kaustubha Govind
2014년 3월 13일
0 개 추천
You can either implement the functionality yourself in C, or find a third-party library that does so, and call it in your MATLAB code using coder.ceval.
댓글 수: 1
Ketan
2014년 3월 15일
Here are few other options:
- Implement the desired filter coefficient calculation yourself in MATLAB and call this code in your function block
- Try to leverage some of the more advanced filter functionality in DSP system toolbox:
카테고리
도움말 센터 및 File Exchange에서 Texas Instruments C2000 Processors에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!