store result in mat

store result in mat