英语翻译%%%%%% ParseInputs%%%function [A,order,domain,s,padopt,msg] = ParseInputs(varargin)A = [];order = [];domain = [];s = [];padopt = 'zeros';msg = '';if (nargin < 3)msg = 'Too few inputs.';return;endif (nargin > 5)msg = 'Too many inputs.';ret
来源:学生作业帮助网 编辑:六六作业网 时间:2024/12/19 15:42:53
英语翻译%%%%%% ParseInputs%%%function [A,order,domain,s,padopt,msg] = ParseInputs(varargin)A = [];order = [];domain = [];s = [];padopt = 'zeros';msg = '';if (nargin < 3)msg = 'Too few inputs.';return;endif (nargin > 5)msg = 'Too many inputs.';ret
英语翻译
%%%
%%% ParseInputs
%%%
function [A,order,domain,s,padopt,msg] = ParseInputs(varargin)
A = [];
order = [];
domain = [];
s = [];
padopt = 'zeros';
msg = '';
if (nargin < 3)
msg = 'Too few inputs.';
return;
end
if (nargin > 5)
msg = 'Too many inputs.';
return;
end
A = varargin{1};
order = varargin{2};
domain = varargin{3};
options = {'zeros','ones','symmetric'};
% padopt of 'ones' is for supporting medfilt2; it is undocumented.
if (nargin == 4)
if (ischar(varargin{4}))
idx = strmatch(lower(varargin{4}),options);
if (length(idx) == 0)
msg = 'Unknown option.';
return;
elseif (length(idx) > 1)
msg = 'Ambiguous option.';
return;
else
padopt = options{idx};
end
else
s = varargin{4};
end
elseif (nargin == 5)
s = varargin{4};
idx = strmatch(lower(varargin{5}),options);
if (length(idx) == 0)
msg = 'Unknown option.';
return;
elseif (length(idx) > 1)
msg = 'Ambiguous option.';
return;
else
padopt = options{idx};
end
end
英语翻译%%%%%% ParseInputs%%%function [A,order,domain,s,padopt,msg] = ParseInputs(varargin)A = [];order = [];domain = [];s = [];padopt = 'zeros';msg = '';if (nargin < 3)msg = 'Too few inputs.';return;endif (nargin > 5)msg = 'Too many inputs.';ret
% % %
% % % ParseInputs
% % %
功能[一个,命令,域,硫,padopt ,味精] = ParseInputs ( varargin )
阿= [ ] ;
为了= [ ] ;
域= [ ] ;
秒= [ ] ;
padopt = '零' ;
味精= '' ;
如果( nargin “ 3 )
味精= '投入太少.' ;
返回;
末端
如果( nargin “ 5 )
味精= '太多的投入.' ;
返回;
末端
为a = varargin ( 1 ) ;
为了= varargin ( 2 ) ;
域= varargin ( 3 ) ;
选项= ( '零' ,'是' ,'对称' ) ;
% padopt的'的'是支持medfilt2 ;它是无证.
如果( nargin == 4 )
如果( ischar ( varargin ( 4 ) ) )
idx = strmatch (较低( varargin ( 4 ) ) ,选项) ;
如果(长度( idx ) == 0 )
味精= '未知的选项.' ;
返回;
elseif (长度( idx ) “ 1 )
味精= '模糊选项.' ;
返回;
其他的
padopt =选择( idx ) ;
末端
其他的
秒= varargin ( 4 ) ;
末端
elseif ( nargin == 5 )
秒= varargin ( 4 ) ;
idx = strmatch (较低( varargin ( 5 ) ) ,选项) ;
如果(长度( idx ) == 0 )
味精= '未知的选项.' ;
返回;
elseif (长度( idx ) “ 1 )
味精= '模糊选项.' ;
返回;
其他的
padopt =选择( idx ) ;
末端
末端