Substitute Function In Matlab