I can conceive using a 'matrix' lib this way:
local m = require 'matrix'
A1 = m'1 2 3' -- m transforms a string into a matrix
A = -A1 -- A is the transpose of A1. minus is the only unary operator in Lua. If you don't like that one, you must use A1.trans or something similar.
B = m'1 1 1; 0 1 1; 0 0 1' -- more parsing
C = B * A -- totally possible in lua via metatables
C['2,3'] = 4 -- Cheat and use strings to index matrices. A bit dirty, yes. But see below.
D = B .. A -- The concatenation operator (or the power operator: ^) could be used for that one
E = B['1:2,end-1'] -- again, use a string to index the table. This is consistent with the previous usage