Accidentally overrode 'filter' function, how can I get it back?
9 次查看(过去 30 天)
显示 更早的评论
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 个评论
回答(1 个)
Star Strider
2019-4-3
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 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Entering Commands 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!