1. Roots of polynomials >> f = [ 1 0 -1 0 ] % f(x) = x**3 - x**2 >> r = roots(f) r= 0 -1 1 >> err = polyval(f,r) % confirm by evaluation f at the proposed roots err = 0 0 0 >> poly(r) % construct polynomial from roots r ans = [ 1 0 -1 0] 2. Roots of functions (non polynomial) >> f = @ (x) (sin(x) -x) >> r = fzero(f,0); >> r = fzero('cos(x)-x',0); >> err = feval(f,0); >> r= fzero(f,[-pi pi]); % range for roots : bisection >> r= fzero(f,[-pi pi], 1e-10); % tolerance for root finding >> yi = interp1(x,y,xi,method) x, y are two given vectors y(i) = f(x(i)) for all x(i), y(i) i =1 , ... length(x) Interpolation determines f such that y=f(x). Then yi is going to be computed for given vector xi i.e. yi = f(xi) method is one of 'nearest', 'linear', 'spline', 'cubic'