* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates * and open the template in the editor. */ package javaapplication3; /** * * @author pacor */ public class JavaApplication3 { /** * @param args the command line arguments */ public static void main(String[] args) { // TODO code application logic here int[][] m1 = {{1,0,2},{-1,3,1}}; int[][] m2 = {{3},{2},{1}}; int[] v = {3,2,1}; int col_m1 = m1[0].length; int fil_m1 = m1.length; int[][] multiplicacion = new int[fil_m1][1]; for (int x=0; x < multiplicacion.length; x++) { for (int y=0; y < multiplicacion[x].length; y++) { // El nuevo bucle suma la multiplicacin de la fila por la columna for (int z=0; z<col_m1; z++) { multiplicacion [x][y] = m1[x][z]*v[z]; System.out.print(multiplicacion[x][y]); System.out.print("\t"); } System.out.println(""); } } } }