楼主: Mailand
15378 12

[求助]怎样生成服从三角分布的随机数。 [推广有奖]

11
gaojianli110 发表于 2013-3-18 13:43:57
zfxmail 发表于 2010-7-3 17:00
二楼的附件与三角分布好象无关,楼上的程序代码可以。谢谢
三楼的貌似也不能运行啊:??? y = (u<= B/(A-C)).*sqrt((A-C)*(B-C)*u)+(u>B/(A-C)).*(A-sqrt((1-u)*(A-C)*(A-B)) ;                                         |
Error: Incomplete or misformed expression or statement.

12
gaojianli110 发表于 2013-3-18 14:00:00
zfxmail 发表于 2010-7-3 17:00
二楼的附件与三角分布好象无关,楼上的程序代码可以。谢谢
哦,不好意思,楼主楼上的程序是对的,只是倒数第二行最后一句少了一个右括号

13
zhoumiemie 发表于 2022-3-4 19:00:25
jyliao 发表于 2007-8-25 16:30
If A=-5, B=5, C=0;
I can show you a matlab program to do the simulation job, later!
So how do you generate random numbers that follow an inverted triangle distribution

您需要登录后才可以回帖 登录 | 我要注册

本版微信群
加好友,备注cda
拉您进交流群
GMT+8, 2025-12-25 05:37