Matlab Code Applied