factorial.m

来自「基于OFDM的无线宽带系统仿真It contains mainly two pa」· M 代码 · 共 11 行

M
11
字号
function p = factorial(n)
%FACTORIAL Factorial function.
% Does the same as the matlab factorial function. This one is added for those
% who do not have it in their matlab installation.  

if (length(n)~=1) | (fix(n) ~= n) | (n < 0)
  error('N must be a positive integer'); 
end

p = prod(1:n);

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?