MATLAB Answers

zpk function is missing

32 views (last 30 days)
Arash Kohli
Arash Kohli on 29 Mar 2021
Answered: Ahmed Redissi on 14 Apr 2021 at 15:01
I am using MATLAB R2020b, and Signal processing toolbox Ver. 8.5. The "zpk" function does not work. I have already tried following recommendation but no success:
restoredefaultpath
rehash toolboxcache
Please help me.
  1 Comment
Fangjun Jiang
Fangjun Jiang on 31 Mar 2021
There is no zpk() function in Signal Processing Toolbox Ver 8.5. What is the error of zpk() in R2020b if you have the Control System Toolbox?

Sign in to comment.

Answers (3)

Fangjun Jiang
Fangjun Jiang on 29 Mar 2021
I believe zpk() requires Control System Toolbox. Check to see if you have it
ver control
  1 Comment
Arash Kohli
Arash Kohli on 31 Mar 2021
Thank you. I have installed it.

Sign in to comment.


Star Strider
Star Strider on 29 Mar 2021
In the Signal Processing Toolbox, the [z,p,k] output is optional for several filter design functions. Use those with (for example) zp2sos or others to design the filter to be used with filtfilt to filter a signal.
  2 Comments
Star Strider
Star Strider on 31 Mar 2021
There are sevral. One zpk is in the Control System Toolbox, another zpk (introduced in R2014a) is in the Signal Processing Toolbox. (There are others as well, however I do not have those Toolboxes.)
Choose the one that works in the context of what you are doing.

Sign in to comment.


Ahmed Redissi
Ahmed Redissi on 14 Apr 2021 at 15:01
Hi,
While there is no "zpk" function in the Signal Processing Toolbox, there is a method called "zpk" of the object "digitalFilter". If you have the Signal Processing Toolbox, you can call the "zpk" function if the input is a digitalFilter object. Here's an example:
hpFilt = designfilt('highpassiir','FilterOrder',8, ...
'PassbandFrequency',75e3,'PassbandRipple',0.2, ...
'SampleRate',200e3);
[z,p,k] = zpk(hpFilt);
You can learn more about it here:

Community Treasure Hunt

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

Start Hunting!