First argument must be a vector.; Function call failed.

Illustration
raztiwaripersonal - 2020-12-14T10:34:51+00:00
Question: First argument must be a vector.; Function call failed.

I am trying to conver a function to C using coder. I am using inbuilt function 'filtfilt'. Function executes properly but when i try to convert it to C i get following errors: 1.Function call failed. 2.First argument must be a vector. 3. Undefined function or variable 'W'. The first assignment to a local variable determines its class. for this line in function: W= filtfilt(digfilt1,1,y1); where digfilt1 and y1 are both of type double.

Expert Answer

Profile picture of John Williams John Williams answered . 2025-11-20

I can see that you are using MATLAB R2018a. The codegen support for filtfilt is improved significanlty in the later releases.
I tried the below command in R202a and it is working fine for me :
 
>> codegen -config:lib filtfilt -args {0,1,1:2} -report


Not satisfied with the answer ?? ASK NOW

Get a Free Consultation or a Sample Assignment Review!