matlab scripts

make a matlab version of the scripts