In the case of P300, the discriminant function is classifying the responses as P300-like vs not-P300-like. i.e., it is a two-class classifier. (Then, when selecting the intended target, we usually choose the target that had the largest P300-like score).
In the case of a two-class dependent variable, LDA and linear regression are identical. See
here for more.
So the Matlab function you want is
stepwisefit, part of the statistics toolbox. This is the function that is used by the P300Classifier.