% Metodos iterativos para resolver sistemas de ecuaciones clear clc f = @(x) [ x(1)+2*x(2)-2; x(1)^2 + 4*x(2)^2 - 4]; % buscamos x^* = [0; 1] % g = @(x) [ 2*x(1)+2*x(2)-2; x(1)^2 + 4*x(2)^2 - 4 + x(2)]; g = @(x) [ -2*x(2)+2; sqrt(4-x(1)^2)/2]; x = [0.05;0.95] k = 0; anterior = inf; while norm(x-anterior) > 1e-6 && k < 10 anterior = x; x = g(x) k = k+1; end