% A es la matriz de coeficientes
% b es el vector de terminos independientes
% x es el vector solucion
% n es el orden del sistema
[n,m] = size(A);
% eliminacion
for i=1:n
for k=i+1:n
factor = (A(k,i)/A(i,i));
A(k,i:n) = A(k,i:n) - factor*A(i,i:n);
b(k) = b(k) - factor*b(i);
end
end
%sustitucion inversa
x = zeros(1,n);
x(n) = b(n)/A(n,n);
for k=n-1:-1:1
x(k) = (b(k) - sum(x(k+1:n).*A(k,k+1:n)))/A(k,k);
end
x
import java.util.ArrayList; public class Cliente { private String nombre; private ArrayList boletas; public Cliente(String nombre) { this.nombre = nombre; this.boletas = new ArrayList(); } public String getNombre() { return this.nombre; } public void agregarBoleta(Boleta boleta) { boletas.add(boleta); } public void imprimirHistorial() { Boleta b; System.out.println("Nombre: " + nombre); for (int i=0; i b = (Boleta)boletas.get(i); b.imprimir(); } } } public class Articulo { private String descripcion; private int stock; private int precio; public Articulo(String descripcion,int stock,int precio){ this.descripcion = descripcion; this.stock = stock; this.precio = precio; } public String getDescripcion() { return this.descripcion; } public int getStock() { return this.stock; } public int getPrecio() { return this.precio; } } import java.util.ArrayList; public class Boleta { private String fecha; private int total; private ArrayList ar...
Comments