A linear discriminant analysis program based on Mahalanobis distance is developed using MATLAB to classify apples based on colour. This method assumes that the reference data is distributed in a multi dimensional space and classifies the test data based on distance between the test data to the reference data sets. The algorithm considers a two-class problem