how to new Mat In C++, we can dynamically create pointer like this: int nCount = 5; float *fBuffer = new float[nCount];