matlab version complete
updated matlab code