Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: not showing any result when i use while.
Replies: 1   Last Post: Oct 25, 2012 3:40 PM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
srishti

Posts: 12
Registered: 9/15/12
not showing any result when i use while.
Posted: Oct 25, 2012 3:16 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

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?



Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.