View Single Post
  #3  
Old July 6th, 2009, 01:03 AM
anizatie anizatie is offline
Newbie
 
Join Date: Jul 2009
Location: malaysia
Posts: 3
Country:
Thanks: 0
Thanked 0 Times in 0 Posts
anizatie is on a distinguished road
Send a message via Yahoo to anizatie
Default

Quote:
Originally Posted by CaptainBlack View Post
Code:
function a = lukis(a0,s,n)
 
lamda = 1.0*(10e-6);
m = 2;
a=zeros(1,n);
a(1) = a0;
 
for i = 1:n-1
  a(i+1) = a(i) + lamda * a(i).^(m/2) * s.^m
 
  if(a(i+1)>1)
    break;
  end
end
 
plot(a(i+1))
 
hold on
 
save('lukis', 'a')
CB

thanks for your reply. its helping me a lot but when the value of a(i+1)>1, the operation still go on, the iterations should stop when a(i+1) reach 1.

by looking at the program, it seem notin wrong there.. hope u can help me.. thanks.
Reply With Quote