Advertisement
Guest User

suite 1

a guest
Jun 17th, 2019
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.74 KB | None | 0 0
  1. /*
  2. //SUITE 1
  3.  
  4. function u=suite1(f,u1,n)
  5. //termes d'une suite
  6. u=u1
  7. for i=1:n-1
  8. u(i+1)=f(u(i))
  9. end
  10. plot(u,'-*r')
  11. xgrid(3)
  12. disp(u)
  13. endfunction
  14.  
  15.  
  16. u11=0
  17. function y=f1(x)
  18. y=sqrt(x+1)
  19. endfunction
  20.  
  21. u12=0
  22. function y=f2(x)
  23. y=0.5*x+2
  24. endfunction
  25.  
  26. u13=1
  27. function y=f3(x)
  28. y=sqrt(2*x+1)
  29. endfunction
  30.  
  31. u14=2
  32. function y=f4(x)
  33. y=(2*x+1)/(x-4)
  34. endfunction
  35.  
  36. u15=1
  37. function y=f5(x)
  38. y=(x/2)+(1/x^2)
  39. endfunction
  40.  
  41. u16=1
  42. function y=f6(x)
  43. y=sqrt(cos(x))
  44. endfunction
  45.  
  46.  
  47. clf
  48. subplot(2,3,1)
  49. suite1(f1,u11,20)
  50. subplot(2,3,2)
  51. suite1(f2,u12,20)
  52. subplot(2,3,3)
  53. suite1(f3,u13,20)
  54. subplot(2,3,4)
  55. suite1(f4,u14,20)
  56. subplot(2,3,5)
  57. suite1(f5,u15,20)
  58. subplot(2,3,6)
  59. suite1(f6,u16,20)
  60. */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement