Error Reported By S Function Matlab