Error occurred for zp2sos while generating C code from matlab code

2 views (last 30 days)
Hi ,
I am geeting error at zp2sos function while converting c code from matlab using coder .
Function 'zp2sos' not supported for code generation.
Above line is the error I got .
Any alternative way to solve this?
I want to convert this zp2sos to c code .
Or should I change the method of converting matlab code to c.
I want to use the C code in other application.
Please answer this.
Thank you
  1 Comment
632541
632541 on 12 Apr 2021
This is the piece of code
[n,Ws] = cheb2ord(Wp,Ws,Rp,Rs); % Filter Order
[z,p,k] = cheby2(n,Rs,Ws); % Filter Design, Sepcify Bandpass
[sos,g] = zp2sos(z,p,k); % Convert To Second-Order-Section For Stability
%freqz(sos, 2^16, Fs) % Filter Bode Plot
x_data = filtfilt(sos, g, x); % Filter Signal

Sign in to comment.

Answers (0)

Community Treasure Hunt

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

Start Hunting!