I have written a following code :
mu = mean(20x1) ;sigma =std(20x1) ;x = temp value (300x1); y1 = zeros(size(x));
y2 = zeros(size(x)); z = zeros(size(x)); p = zeros(size(x));
for k = 1:length(x) for j=1:length(mu) if x(k) > mu(j) z(k) =x(j); y1=cdf('normal',z,mu(j),sigma(j),'upper'); elseif x(k)< mu(j) p =x(k); y2 = cdf('normal',p,mu(j),sigma(j),'lower'); end end end
Now In this programme I am comparing whether my 'x' value is greater or less than the calculated mean value or not. If x>mu then I am storing all those x value in 'z' and with that z value I am trying to calculate y1. Similarly if x < mu value than those x value stored in p and with this p value I am trying to calculate y2 value. I am first year of my engineering so I have very limited knowledge about matlab. help me if I am somewhere wrong in my programming.
Aucun commentaire:
Enregistrer un commentaire