function[A b] = calcularAb_lab3(h)
% retorna matriz A y vector b en pregunta 3 del laboratorio 3

n = 1/h - 1;
A = create_trid(n,2,-1,-1);
A = (1/h^2)*A;

b = -4*ones(n,1)+1/h^2*[1;zeros(n-2,1);1];


% para resolver pregunta 4 en lab 3
% h = 0.1
% [A b] = calcularAb_lab3(h)
% R = chol(A)
% u = R\(R'\b);
% u = [1; u; 1]
% plot([0 h:h:1-h 1],u)
% hold on
% x = linspace(0,1,100);
% plot(x,2*x.^2-2*x+1,'r');
