a = [38 2 13; 5 23 11; 19 3 17] b = [6 17 29; 43 15 8; 1 4 22] c = [14 9 1; 2 31 7; 8 20 6] in matlab

To multiply matrices a, b and c using matrix multiplication in MATLAB, use the following code:

main.m
result = a * b * c;
20 chars
2 lines

Note that matrix multiplication is associative but not commutative, that's why we have to multiply both a and b first and then c.

gistlibby LogSnag