Why replace isequalwithequalnans with isequaln?

조회 수: 9 (최근 30일)
David
David 2012년 12월 11일
댓글: Felipe G. Nievinski 2014년 10월 29일
Regarding the switch in 2012a [1]:
Other Functionality Being Removed or Changed
Functionality: isequalwithequalnans
What Happens When You Use This Functionality: Still Runs
Use This Instead: isequaln
Compatibility Considerations: Replace all instances of isequalwithequalnans with isequaln.
Comments [2,3] have suggested that the reason for the switch is just to shorten the name of the function. Is this the true change, or is there any other benefit (performance) to consider in the new function?
Thanks for your comments.

채택된 답변

Jan
Jan 2012년 12월 12일
As long as isequalwithequalnans is still support, I cannot see a problem.
I assume the new function name isequaln was chosen, because the old one is the most ugly function name I've ever seen.
  댓글 수: 4
Jan
Jan 2012년 12월 12일
@David: There have been and will be much more substantial changes than just the name of this function.
In my startup.m file a folder depending on the running Matlab version is included, which stores functions for forward and backward compatibility. On demand you can add a function in such a folder for patches:
function Out = isequalwithequalnans(varargin)
Out = isequaln(varargin{:});
Felipe G. Nievinski
Felipe G. Nievinski 2014년 10월 29일
Never overemphasized: It'll break backwards compatibility!
If you don't want to bother with conditional seach-path inclusion, just create the following file isequaln.m:
function varargout = isequaln (varargin)
try
[varargout{1:nargout}] = builtin ('isequaln', varargin{:});
catch
[varargout{1:nargout}] = builtin ('isequalwithequalnans', varargin{:});
end
end
Fortunately warnings identified as 'MATLAB:dispatcher:nameConflict' will only be issued once, not everytime the function is called.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Relational Operations에 대해 자세히 알아보기

제품

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by