"Ben Lange" <email@example.com> wrote in message news:firstname.lastname@example.org... > I experienced this issue in the following scenario. > > Initially I named my .m file HW1.m, it worked fine. > I then renamed my .m file to be HW1-NearestNeighboar.m. > > I experienced the dreaded Undefined function or variable error. > > I then changed the - to _ and everything worked fine. > > Apparenly, MatLab doesn't support - characters in the *.m filename.