FUNCTION REFERENCE

LinearModel.predict

Predict responses from a fitted LinearModel object.

Predict responses from a fitted LinearModel object.

Syntax

ypred = predict(mdl, Xnew)

Syntax

ypred = mdl.predict(Xnew)

Syntax

[ypred, yci] = predict(mdl, Xnew)

predict(mdl, Xnew) returns fitted values and, with two outputs, confidence intervals. The method form mdl.predict(Xnew) returns only the predictions.

Example

mdl = fitlm([1; 2; 3; 4], [2; 4; 6; 8]); mdl.predict(5)   % 10

Differences from MATLAB: Supports numeric matrix predictors and pointwise confidence intervals.

These are the engine’s help pages. Each page keeps its compatibility notes. File operations are unavailable in the browser.