n_tol.m 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. data=csvread('bisection_poly_B.csv'); % reading csv file
  2. X = data(:,1);
  3. Y = data(:,2);
  4. figure;
  5. hold on;
  6. grid on;
  7. plot(X, Y);
  8. legend('Bisection method');
  9. title("$\bf Tolerance(Iteration) \; 0.25 \cdot x^3 + x - 1.2502 = 0$", 'Interpreter','latex');
  10. xlabel('Iteration')
  11. ylabel('Tolerance')
  12. data=csvread('secant_poly_B.csv'); % reading csv file
  13. X = data(:,1);
  14. Y = data(:,2);
  15. figure;
  16. hold on;
  17. grid on;
  18. plot(X, Y);
  19. legend('Secant method');
  20. title("$\bf Tolerance(Iteration) \; 0.25 \cdot x^3 + x - 1.2502 = 0$", 'Interpreter','latex');
  21. xlabel('Iteration')
  22. ylabel('Tolerance')
  23. data=csvread('bisection_alg_B.csv'); % reading csv file
  24. X = data(:,1);
  25. Y = data(:,2);
  26. figure;
  27. hold on;
  28. grid on;
  29. plot(X, Y);
  30. legend('Bisection method');
  31. title("$\bf Tolerance(Iteration) \; x^4 - 3 \cdot x^3 - 9 \cdot x - 9 = 0$", 'Interpreter','latex');
  32. xlabel('Iteration')
  33. ylabel('Tolerance')
  34. data=csvread('secant_alg_B.csv'); % reading csv file
  35. X = data(:,1);
  36. Y = data(:,2);
  37. figure;
  38. hold on;
  39. grid on;
  40. plot(X, Y);
  41. legend('Secant method');
  42. title("$\bf Tolerance(Iteration) \; x^4 - 3 \cdot x^3 - 9 \cdot x - 9 = 0$", 'Interpreter','latex');
  43. xlabel('Iteration')
  44. ylabel('Tolerance')
  45. data=csvread('bisection_algbrake_B.csv'); % reading csv file
  46. X = data(:,1);
  47. Y = data(:,2);
  48. figure;
  49. hold on;
  50. grid on;
  51. plot(X, Y);
  52. legend('Bisection method');
  53. title("$\bf Tolerance(Iteration) \; -\frac{x^4 + 3 \cdot x^3 - 9 \cdot x - 9}{x - 1.5} = 0$", 'Interpreter','latex');
  54. xlabel('Iteration')
  55. ylabel('Tolerance')
  56. data=csvread('secant_algbrake_B.csv'); % reading csv file
  57. X = data(:,1);
  58. Y = data(:,2);
  59. figure;
  60. hold on;
  61. grid on;
  62. plot(X, Y);
  63. legend('Secant method');
  64. title("$\bf Tolerance(Iteration) \; -\frac{x^4 + 3 \cdot x^3 - 9 \cdot x - 9}{x - 1.5} = 0$", 'Interpreter','latex');
  65. xlabel('Iteration')
  66. ylabel('Tolerance')