- #1
hbz88
- 2
- 0
Hi, I need some helps. I try to run the code below but its keep give me the value of intial value.
Matlab:
Q = 1415; \[Mu] = 1000; \[Sigma] = 500;
double dx;
double x;
double fx;
double fxplusdx;
double I1;
double I2;
I1 = 0;
I2 = 0;
For[x = 0, x <= Q - dx, dx += 0.01,
fx = PDF[NormalDistribution[0, 1], (
InverseCDF[NormalDistribution[\[Mu], \[Sigma]],
x] - \[Mu])/\[Sigma]];
fxplusdx =
PDF[NormalDistribution[0, 1], (
InverseCDF[NormalDistribution[\[Mu], \[Sigma]],
x + dx] - \[Mu])/\[Sigma]];
I1 = I1 + 0.5*(x*fx + (x + dx)*fxplusdx)*dx;
I2 = I2 + 0.5*(fx + fxplusdx)*dx]
I1
I2 [/code/
Thank you in advance
Last edited by a moderator: