求大神解答Matlab,有数学建模大神么

2024年12月01日 14:29
有2个网友回答
网友(1):

function a = m72(varargin)
optargin = size(varargin, 2);
if optargin==1
a='wrong';
disp(a);
end
if optargin==2
disp(factorial(varargin{1})+factorial(varargin{2}));
a = factorial(varargin{1})+factorial(varargin{2})
else if optargin==3
disp(factorial(varargin{1})+factorial(varargin{2})+factorial(varargin{3}));
a = factorial(varargin{1})+factorial(varargin{2})+factorial(varargin{3});
end
end

网友(2):