Professional Documents
Culture Documents
PRESENTADO POR:
NESTOR IVAN OSPINA GAITAN 223664
JUAN PABLO MORENO CASTRO 215692
DAVID ERNESTO RAMIREZ DIAZ 223327
METODOS NUMERICOS
LABORATORIO 2
SOLUCIN DE SISTEMAS LINEALES MEDIANTE MATRICES
INTRODUCCION
1. CODIGO SCILAB
clc;
clear;
disp(" ** Laboratorio 03 / Grupo 05 ** ") // Segn sea el caso
disp("Codigos: 02223664 - 02215692 - 02223327") // En concordancia con los
participantes del grupo
ww=getdate(); // Obtencin de la fecha y hora de ejecucin del programa
mprintf( "AA:%d ,MM:%d ,DD:%d a las HH:%d ,MM:%d ,SS:%d
",ww(1),ww(2),ww(6),ww(7),ww(8),ww(9));
m1= input('Ingrese el numero de puntos : ') ;
m=m1;
a1=[];
b1=[];
c1=[];
d1=[];
disp("Datos necesarios para el metodo de Lagrange")
disp("Ingrese los coeficientes xi")
for b=1:m
ax= input('coeficiente: ') ;
a1=[a1;ax];
end
disp("Ingrese los coeficientes f(xi)")
for a=1:m
bx= input('coeficiente: ') ;
b1=[b1;bx];
end
disp("xi
f(xi)");
a2=[a1 b1]
disp("Datos para el metodo de Newton")
disp("Ingrese los coeficientes xi")
for c=1:m
los
x=[a1(1):0.1:a1(m)]';
subplot(1,2,1)
plot(x,horner(p,x));
xlabel( " Xi (Presion) " ) ;
ylabel(" f(xi) (Grados Centigrados C) " ) ;
title("Polinomio de Lagrange" ) ;
a=gca();
a.grid=[1,2];
x=[c1(1):0.1:c1(m)]';
subplot(1,2,2)
plot(x,horner(pf,x));
xlabel( " Xi " ) ;
ylabel(" f(xi) " ) ;
title("Polinomio de Newton" ) ;
a=gca();
a.grid=[1,2];
3. CONCLUSION