Docsity

MATLAB Code for Finding the Square Root using Bisection Method, Exercises of Calculus

Partial preview of the text

Download MATLAB Code for Finding the Square Root using Bisection Method and more Exercises Calculus in PDF only on Docsity!

%% BISSECÇÃO %%

%% configuração MATLAB format long clc clear close all %% entrada x = -0.75; %%% menor valor do intervalo [x,X] X = -0.25; %%%maior valor do intervalo l = 1; %%%valor limite %% Conta for k = 1:l Y = (x+X)/2; %%f(a) f = x^5-(10/9)x^3+(5/21)x; %%f(y) h = Y^5-(10/9)Y^3+(5/21)Y if f< X = Y; else x = Y; end k = k+1; end Y