moniter added. fix "segmentation violation" caused by writing into *.mat in C++