LDA: Linear Discriminant Analysis

Performs linear discriminant analysis.

You are now following this Submission

Features of this implementation of LDA:
- Allows for >2 classes
- Permits user-specified prior probabilities
- Requires only base MATLAB (no toolboxes needed)
- Assumes that the data is complete (no missing values)
- Has been verified against statistical software
- "help LDA" provides usage and an example, including conditional probability calculation

Note: This routine always includes the prior probability adjustment to the linear score functions. (Some other LDA software drops this when the user specifies equal prior probabilities.)

Cite As

Will Dwinnell (2026). LDA: Linear Discriminant Analysis (https://www.mathworks.com/matlabcentral/fileexchange/29673-lda-linear-discriminant-analysis), MATLAB Central File Exchange. Retrieved .

General Information

MATLAB Release Compatibility

  • Compatible with any release

Platform Compatibility

  • Windows
  • macOS
  • Linux
Version Published Release Notes Action
1.0.0.0