Hello,
I would like to use a filter in a parfor loop. Using [b,a] coefficients there is no problem. Because of a better stability I have to use the [z,p,k] coefficients. It perfectly works in a for loop. However, in a parfor loop the error massage "Not enough input arguments." appears. Does anyone know a workaround?
Here is a little example: Anything works but the last loop!
% Signal
x = sin(0:pi/1000:10*pi);% Filter properties
N = 1;fc = 1/(2*pi);fs = 1000/pi;Wn = fc/(fs/2);ftype = 'low';% Transfer Function design
[b,a] = butter(N,Wn,ftype); % Zero-Pole-Gain design
[z,p,k] = butter(N,Wn,ftype);[sos,g] = zp2sos(z,p,k);hd = dfilt.df2tsos(sos, g); %%Loops
for n=1:2 y = filter(b,a,x);endparfor n=1:2 y = filter(b,a,x);endfor n=1:2 y = filter(hd, x);endparfor n=1:2 y = filter(hd, x);end
Best Answer