ex4 matrix version

Signed-off-by: David JY Lu <davidlue7@gmail.com>