A study on real-time recognition of handwritten mathematical expression including matrix structure