Problem: Undefined function 'zpk' for input arguments of type 'double'.

6 views (last 30 days)
I am using MATLAB R2012b and trying to do a function that uses zero pole gain parameter. The problem occured when I tried to uses the zero pole gain function. It produces "Undefined function 'zpk' for input arguments of type 'double'." error. Basically, the input (value of z, p and k) are in the form of array but in this case (from my understanding), it detects as double. Below is my coding that may involved in this problem:
n = 1;
w = 2*pi*f1;
[z, p, k] = butter(n,w, 'high', 's'); % Zero-Pole-Gain design
hp = zpk(z,p,k); % creates a continuous-time zero-pole-gain model
I've tried to troubleshoot it quite a lot of times already but it produces the same result. Hope anyone can solve this problem can come forward. Thanks.

Answers (1)

Star Strider
Star Strider on 1 Mar 2015
I don’t understand what you’re trying to do.
Your filter is already in ‘z,p,k’ form. The zpk function is designed to take the output of the designfilt function and produce a ‘z,p,k’ representation from it.
From there, you can use the ‘z,p,k’ representation in filtfilt, or if you want to produce the most stable filter representation, use the zp2sos function and use the ‘sos’ and ‘g’ output as your filter parameters in filtfilt.

Community Treasure Hunt

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

Start Hunting!