srishti
Posts:
12
Registered:
9/15/12
|
|
not showing any result when i use while.
Posted:
Oct 25, 2012 3:16 PM
|
|
SD = 1; while SD > 1 h=x; % maximum envelope maxi=[]; mapo=[]; for i=1:250:200000; [c,d]=max(h(i:i+249)); maxi=[maxi,c]; mapo=[mapo,d+(i-1)]; end yy =spline(mapo,maxi,1:200000); plot(mapo,maxi,'o',1:200000,yy); % minimum envelope mini=[]; mipo=[]; for i=1:250:200000; [d,f]=min(h(i:i+249)); mini=[mini,d]; mipo=[mipo,f+(i-1)]; end yy1=spline(mipo,mini,1:200000); figure,plot(mipo,mini,'o',1:200000,yy1); m=(yy+yy1)/2; prevh=h; h=h(1:200000)-m SD =sum ( ((prevh(1:200000) - h).^2) ./ (prevh(1:200000 ).^2) ); end
If I run this code with in while condition then it does not shows the value of YY and yy1,h. But if I run it without while then shows the value of yy,yy1,h,sd.........I am not getting the problem.Can anybody help me out in this?
|
|