Outsource validateInput into another m file