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

2024-12-01 14:29:19
推荐回答(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):