
Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Community
Ask the community for help and clear up your study doubts
Discover the best universities in your country according to Docsity users
Free resources
Download our free guides on studying techniques, anxiety management strategies, and thesis advice from Docsity tutors
Function root was found by bisection method in matlab. this program shows whole midpoint roots...
Typology: Study Guides, Projects, Research
1 / 1
This page cannot be seen from the preview
Don't miss anything!
close all clear all clc syms x f=input('x e bağlı f fonksyonunu girin f:'); f1=diff(f,1); ft=inline(f1); x1=input('Aralığın 1. değerini girin x1:'); xu=input('Aralığın 2. değerini girin x2:'); acc=input('hata oranını girin:'); while ((ft(x1)ft(xu))>0) x1=input('Aralığın 1. değerini girin x1:'); xu=input('Aralığın 2. değerini girin x2:'); disp('Girdiğiniz aralıkta kök yoktur.') end while (abs(xu-x1)>acc) xm=(x1+xu)/2; if(ft(x1)ft(xm)<0) xu=xm; else x1=xm; end
deger=ft(xm); fprintf('*** orta nokta değeri:%f, *** fonksiyondaki değeri:%f \n',xm,deger);
end fprintf('orta yarılama metoduna göre denklemin kökü=%f\n',xm); fprintf('bulunan köke göre optimum değer %f',deger);