MATLAB: Class definition @ directory error

@class

Hello,
I am writing a script wherein a new class 'polynomial' is defined. When I run the script, I get the following error:
Error: File: polynomial.m Line: 49 Column: 10
A class definition must be in an "@" directory.
Upon typing which('polynomial'), I get the following output:
/home/..../multipoly/@polynomial/polynomial.m
Clearly, polynomial.m is in a directory called @polynomial, but I'm still getting the error. I'm quite confused by this. I am running 64bit R2012a on Ubuntu 12.04.
Any help would be appreciated. Thanks.
Adi

Best Answer

I assume that
  • you created the folder "/home/..../multipoly/@polynomial"
  • you created the file "polynomial.m"
  • the keyword, "class" appears in the file "polynomial.m" (line 49)
Do you try to use old or the new Class-Definition Syntax; do you use the new keyword classdef?
Did you try
which('polynomial','-all')