Undefined function or variable 'ordf'.
조회 수: 4 (최근 30일)
이전 댓글 표시
I want to use medfilt2 inside a function, but when I run the code it always gives me that error message saying it is undefined. Could someone give suggestions on how to solve it? Thanks!
댓글 수: 2
Geoff Hayes
2016년 10월 22일
Yan - how does calling the medfilt2 generate the error concerning ordf? Please show some of the code that generates this error and copy and paste the full error message to your question.
Walter Roberson
2016년 10월 23일
I searched through all of the Mathworks-supplied .m files I have installed in my R2016b installation, and do not find any occurrences of a variable named ordf, so it sounds like the difficulty is in code you (or a third-party toolbox) have supplied.
답변 (1개)
Yan Gong
2017년 1월 11일
편집: per isakson
2017년 1월 11일
댓글 수: 1
per isakson
2017년 1월 11일
Run
dbstop if error
B=medfilt2(A,[3 3],'symmetric');
and try to understand what's going on.
On my R2016a it seems to work fine
>> dbstop if error
A=[1 3 3 5 1;0.5 3 0 9 2;1 1 1 1 1;0.4 1.9 24 3.2 5;0 -1 2.7 30 5];
B=medfilt2(A,[3 3],'symmetric');
B
B =
1.0000 3.0000 3.0000 3.0000 2.0000
1.0000 1.0000 3.0000 1.0000 1.0000
1.0000 1.0000 1.9000 2.0000 2.0000
0.4000 1.0000 1.9000 3.2000 5.0000
0 0.4000 2.7000 5.0000 5.0000
>> version
ans =
9.0.0.341360 (R2016a)
In R2016a the code is different; line 82-90 of c:\Program Files\MATLAB\R2016a\toolbox\images\images\ordfilt2.m reads
if isempty(s)
%ORDFILT2(A,ORDER,DOMAIN)
B = ordfilt2mex(A, order, offsets, [padSize padSize] + 1, ...
originalSize, domainSize);
else
%ORDFILT2(A,ORDER,DOMAIN,S,PADOPT)
B = ordfilt2mex(A, order, offsets, [padSize padSize] + 1, ...
originalSize, domainSize, s);
end
참고 항목
카테고리
Help Center 및 File Exchange에서 Digital Filtering에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!