Gamma函数相关matlab代码

1、Gamma函数:

Gamma函数matlab代码:

x=0:0.5:5
syms t y=int(t.^(x-1)*exp(-t),0,inf) y=double(y) plot(x,y,'r-o','linewidth',1)

图像如下:

 

2、lgΓ(x)函数

matlab代码:

x=0:0.1:5
syms t y=int(t.^(x-1)*exp(-t),0,inf) y=log10(double(y)) plot(x,y,'r-o','linewidth',1)

图形:

 

Gamma分布:

matlab代码:

a=1,b=0.5
syms c
d=int(c^(a-1)*exp(-c),0,inf)
t=0:0.1:20
g=b.^a*(t.^(a-1)).*exp(-b*t)/d
g=double(g)
plot(t,g,'r-.','linewidth',1)

图形:

matlab代码:

t=0:0.1:20
syms c

a=1,b=0.5
d=int(c^(a-1)*exp(-c),0,inf)
g=b.^a*(t.^(a-1)).*exp(-b*t)/d
g=double(g)
plot(t,g,'r-.','linewidth',1)
hold on;
a=2,b=0.5
d=int(c^(a-1)*exp(-c),0,inf)
g=b.^a*(t.^(a-1)).*exp(-b*t)/d
g=double(g)
plot(t,g,'g-.','linewidth',1)
hold on
a=3,b=0.5
d=int(c^(a-1)*exp(-c),0,inf)
g=b.^a*(t.^(a-1)).*exp(-b*t)/d
g=double(g)
plot(t,g,'b-.','linewidth',1)
hold on
a=5,b=1
d=int(c^(a-1)*exp(-c),0,inf)
g=b.^a*(t.^(a-1)).*exp(-b*t)/d
g=double(g)
plot(t,g,'c-.','linewidth',1)
hold on
a=9,b=2
d=int(c^(a-1)*exp(-c),0,inf)
g=b.^a*(t.^(a-1)).*exp(-b*t)/d
g=double(g)
plot(t,g,'m-.','linewidth',1)
hold on;
legend('a=1,b=0.5','a=2,b=0.5','a=3,b=0.5','a=5,b=1','a=9,b=2');

图形:

转载于:https://www.cnblogs.com/NaughtyBaby/p/4285500.html

  • 1
    点赞
  • 17
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值