⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 stirling2.m

📁 一些常被用于教学或者参考的概率论的实例的源代码
💻 M
字号:
%stirling2.m
clear
for n=1:150
   f(n)=gamma(n+1);
   s(n)=exp(-n)*(n^50)*(n^(n-50));
end
subplot(1,2,1)
semilogy(f-s)
grid
xlabel('n')
ylabel('Absolute Error')
title('n! - [n^ne^-^n]')
subplot(1,2,2)
plot(f./s)
grid
xlabel('n')
ylabel('Relative Error')
title('n!/[n^ne^-^n]')
figure(1)

⌨️ 快捷键说明

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