NotesWhat is notes.io?

Notes brand slogan

Notes - notes.io

Bisection Method Code:

clear all clc f=input(' Enter a function: '); a=input(' Enter start of interval: '); b=input(' Enter end of interval: '); e=input(' Enter percentage error: '); if (feval(f,a)==0) display('a is the root of the equation ' ); elseif (feval(f,b)==0) display('b is the root of the equation ' ); elseif feval(f,a)*feval(f,b)> 0 display (' this interval is invalid '); else xn=(a+b)/2; while (abs((xn-a)/(xn))*100>e || abs((xn-b)/(xn))*100>e) if feval(f,a)*feval(f,b)<0 xn=(a+b)/2; f_xn=feval(f,xn); if f_xn*feval(f,a)<0 b=xn; elseif f_xn*feval(f,a)>0 a=xn; else display(xn + 'is the root') end end end display (' the root is ') ; disp(xn) end

Newton Raphson Method Code:

clear all clc f=input(' Enter a function: '); x0=input(' Enter the intial guess: '); e=input(' Enter percentage error '); fdiff= input(' please enter derivative of the function '); if (feval(f,x0)==0) display('x0 is the root of the equation ' ); else xn=x0-(feval(f,x0)/feval(fdiff,x0)); en=abs((xn-x0)/xn)*100; while en>e xn=x0-feval(f,x0)/feval(fdiff,x0); en=abs((xn-x0)/xn)*100; x0=xn; end disp('the root is: ') disp(xn) end

Lagrange Interpolation Code:

clear all clc X=input('Enter the values of x in vector form: '); Y=input('Enter the values of f(x) in vector form: '); p=input('Enter the point to interpolate at: '); n=length(X); degree=n-1; syms x m=1; for i=1:n for j=1:n if i~=j l(m)=(x-X(j))./(X(i)-X(j)); m=m+1; end end L(i)=prod(l); m=1; end poly=sum(Y(1:n).*L); s=simplify(poly); display('The value of the polynomial at x= ') disp(subs(s,p))
     
 
what is notes.io
 

Notes.io is a web-based application for taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000 notes created and continuing...

With notes.io;

  • * You can take a note from anywhere and any device with internet connection.
  • * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
  • * You can quickly share your contents without website, blog and e-mail.
  • * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
  • * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.

Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.

Easy: Notes.io doesn’t require installation. Just write and share note!

Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )

Free: Notes.io works for 12 years and has been free since the day it was started.


You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;


Email: [email protected]

Twitter: http://twitter.com/notesio

Instagram: http://instagram.com/notes.io

Facebook: http://facebook.com/notesio



Regards;
Notes.io Team

     
 
Shortened Note Link
 
 
Looding Image
 
     
 
Long File
 
 

For written notes was greater than 18KB Unable to shorten.

To be smaller than 18KB, please organize your notes, or sign in.