SHARE
TWEET

Untitled

a guest Jun 8th, 2019 95 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function x=cubica(v,ep)
  2. if v < 0
  3.     signo = -1;
  4. else
  5.     signo = 1;
  6. end
  7.     v = abs(v);
  8.  k=1;
  9.  while true
  10.     x=(1./3).*((v./k.^2)+2*k);
  11.     if abs((v.^(1./3)-x)/v.^(1./3))*100<=ep;
  12.         break
  13.     else
  14.         k=k+0.01;
  15.     end
  16.  end
  17.     x = x * signo;
  18. end
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top