generate result mtx