Accidentally overrode 'filter' function, how can I get it back?
9 views (last 30 days)
Show older comments
I accidentally overrode the 'filter' function by making a user defined function also named 'filter'.
I tried to clear it by doing
builtin('function')
but that just got me an error:
'Error using filter
Not enough input arguments.'
How can I make sure I have the builtin 'filter' function back?
0 Comments
Answers (1)
Star Strider
on 3 Apr 2019
It’s probably still there.
first run this line from a script or your Command Window:
which filter -all
When I ran it, I got:
built-in (C:\Program Files\MATLAB\R2019a\toolbox\matlab\datafun\filter)
filter is a Java method % Shadowed java.util.Locale method
filter is a built-in method % Shadowed connector.internal.LoggerLevel method
filter is a built-in method % Shadowed matlab.lang.OnOffSwitchState method
filter is a built-in method % Shadowed matlab.internal.lang.capability.Capability method
C:\Program Files\MATLAB\R2019a\toolbox\matlab\bigdata\@tall\filter.m % Shadowed tall method
C:\Program Files\MATLAB\R2019a\toolbox\simulink\simulink\@SigLogSelector\filter.m % Shadowed SigLogSelector method
C:\Program Files\MATLAB\R2019a\toolbox\fixedpoint\fixedpointtool\@fxptui\filter.m % Shadowed fxptui method
C:\Program Files\MATLAB\R2019a\toolbox\matlab\timeseries\@timeseries\filter.m % Shadowed timeseries method
Then try it with an example from the documentation for filter and see if it still works (after you rename your function named ‘filter’ to something that doesn’t ‘overshadow’ the builtin function).
0 Comments
See Also
Categories
Find more on Entering Commands in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!