Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- matmul[a_, b_] :=
- {{vecmul[a[[1, 1]], b[[1, 1]]] + vecmul[a[[1, 2]], b[[2, 1]]],
- vecmul[a[[1, 1]], b[[1, 2]]] + vecmul[a[[1, 2]], b[[2, 2]]]},
- {vecmul[a[[2, 1]], b[[1, 1]]] + vecmul[a[[2, 2]], b[[2, 1]]],
- vecmul[a[[2, 1]], b[[1, 2]]] + vecmul[a[[2, 2]], b[[2, 2]]]}}
- matmul[a_,b_] := Inner[vecmul[#1, #2] &, a, b]
Add Comment
Please, Sign In to add comment