Undefined function or variable 'ordf'.
4 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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 commentaires
Geoff Hayes
le 22 Oct 2016
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
le 23 Oct 2016
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.
Réponses (1)
Yan Gong
le 11 Jan 2017
Modifié(e) : per isakson
le 11 Jan 2017
1 commentaire
per isakson
le 11 Jan 2017
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
Voir également
Catégories
En savoir plus sur Digital Filtering dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!