fork download
  1. A =[16 2 3 13
  2. 5 11 10 8
  3. 9 7 6 12
  4. 4 14 15 1];
  5.  
  6. B = [1 1
  7. 0 1];
  8.  
  9. @(A,B)cell2mat(arrayfun(@(n)n*B,A,'un',0));
  10.  
  11. ans(A,B)
Success #stdin #stdout 0.46s 121792KB
stdin
Standard input is empty
stdout
ans =

   16   16    2    2    3    3   13   13
    0   16    0    2    0    3    0   13
    5    5   11   11   10   10    8    8
    0    5    0   11    0   10    0    8
    9    9    7    7    6    6   12   12
    0    9    0    7    0    6    0   12
    4    4   14   14   15   15    1    1
    0    4    0   14    0   15    0    1