package matriz;
public class PrincipalMatriz {
int matrizT [][];
int suma [][];
public PrincipalMatriz() {
Matriz obj = new Matriz();
obj.Crear();
}
private void Transponer(Matriz mat) {
matrizT = new int [mat.filas][mat.columnas];
for (int i=0; i < mat.matriz.length; i++) {
for (int j=0; j < mat.matriz[i].length; j++) {
matrizT[j][i] = mat.matriz[i][j];
}
}
}
private void SumaMat(Matriz Mat1, Matriz Mat2) {
suma = new int [Mat1.filas][Mat1.columnas];
for(int i=0; i<Mat1.filas; i++) {
for(int j=0; j<Mat1.columnas; j++) {
suma[i][j] = Mat1.matriz[i][j] + Mat2.matriz[i][j];
}
}
System.out.println("\n\nLa Suma es :");
for(int i=0; i<suma[i].length; i++) {
for(int j=0; j<suma[j].length; j++) {
System.out.print("\t" + suma[i][j]);
}
System.out.println();
}
//return suma;
}
}
Be the first to comment
You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.