CAT arguments dimensions are not consistent while applying a Despike Filter
조회 수: 1 (최근 30일)
이전 댓글 표시
Hi all! i was applying a simple despike filter based on a median filter and got the above error message that CAT arguments dimensions are not consistent.
%extend data vector by n data points at both ends
xi = [flipud(x(1:n)); x; flipud(x(end-n+1:end))];
%apply order n median filter
xfilt = medfilt1(xi,n);
%difference to filterd data
dif = abs(xfilt(1+n:end-n)-x);
%number of spikes
nspike = sum(dif>lim);
%replace spikes with NaNs
x(dif>lim) = NaN;
xout = x;
Where x is the input data (in my case a 1290x6 array), n is order of median filter (n=3 detects spikes consisting of single data points only) and lim is the detection limit (which i set to 4), i.e spike if x(i)-x_filtered(i)>lim .
This filter wordke quite well with other data, i dont see the problem. Thanks for your help!
댓글 수: 2
Adam
2017년 8월 8일
Have you used the debugger and the 'Stop on errors' option from the Breakpoints menu in the editor? These kind of errors are usually trivial to find in seconds if you do that. Whether they are so easy to fix depends entirely on what went wrong and what you intended etc, but at least understanding why the error occurs is very easy.
답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Electrophysiology에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!