Fixed bad use of malloc

I guess at some point matlab api required that you use mxMalloc instead of just malloc