Make more scripts Matlab-compatible