ubicaraices - b=5 % ingreso de la funcion...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
Sheet1 Page 1 % PROGRAMA: UBICA RAICES % Descripcion:El programa divide un intervalo [a, b] en "n" partes iguales y define los intervalos % en los cuales existe una raiz para una funcion f(x). % curso: Calculo Numerico % programacion: Rony Yupanqui G. % fecha: Agosto 2006 % VARIABLES % cantidad de subintervalos n=100 % extremos del intervalo a=-5
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: b=5 % ingreso de la funcion f=inline('cos(x)') % ALGORITMO DEL PROGRAMA disp(' PROGRAMA DE UBICACION DE RAICES') h= (b-a)/n pos= a for i=1: (n-1) val1= feval(f,pos) val2= feval(f,(pos+h)) if (val1*val2)<0 linea =sprintf( ' Existe una raiz en el intervalo = [ %5.8f %5.8f ]', pos,(pos+h)) disp(linea) end pos=pos+h end...
View Full Document

This note was uploaded on 06/18/2008 for the course MATH Calc taught by Professor Doig during the Spring '08 term at Pontifical Catholic University of Peru.

Ask a homework question - tutors are online