[EDIT: 20110627 13:09 CDT – reformat – WDR]
This function will generate a normal distribution conditional by bounds:
i have used above code 3 times and made 3 random variables c, fi, G. now i want to calculate qult.
this is my code :for getting distribution of qult i need to produce 3 different random variables (c, fi, G) by above code and call them in a new code to get answer. how should i use c, fi, G that i produced and call them in a loop to compute qult.
this is my code for qult:
B=1000;L=2000;Sc=1.1;Sq=1.1;Sgama=.8;nsamples=10000; for i=1:nsamples C=C(1,i); G=G(1,i); fi=fi(1,i);Nq=tan((pi/4)+(pi*fi/360))*tan((pi/4)+(pi*fi/360))*2.718^(pi*tan(fi*pi/180)); Nc=(Nq-1)*cot(fi*pi/180); Ngama=2*(Nq+1)*tan(fi*pi/180); qult(i)=(C*Nc*Sc)+(384*Nq*Sq)+(980*Ngama*Sgama); end
Best Answer