Main Content


Plot linear regression



plotregression(targets,outputs) plots the linear regression of targets relative to outputs.

plotregression(targs1,outs1,'name1',targs2,outs2,'name2',...)generates multiple plots.


collapse all

This example shows how to plot the linear regression of a feedforward net.

[x,t] = simplefit_dataset;
net = feedforwardnet(10);
net = train(net,x,t);

{"String":"Figure Neural Network Training (26-Nov-2022 06:05:49) contains an object of type uigridlayout.","Tex":[],"LaTex":[]}

y = net(x);

{"String":"Figure Regression (plotregression) contains an axes object. The axes object with title Regression: R=0.99999 contains 3 objects of type line. These objects represent Y = T, Fit, Data.","Tex":"Regression: R=0.99999","LaTex":[]}

Input Arguments

collapse all

Network targets, specified as a matrix or cell array.

Network outputs, specified as a matrix or cell array.

Version History

Introduced in R2008a