Main Content


Plot dynamic network time series response




plotresponse(t,y) takes a target time series t and an output time series y, and plots them on the same axis showing the errors between them.

plotresponse(t1,'name',t2,'name2',...,y) takes multiple target/name pairs, typically defining training, validation and testing targets, and the output. It plots the responses with colors indicating the different target sets.

plotresponse(...,'outputIndex',outputIndex) optionally defines which error element is being correlated and plotted. The default is 1.


Plot Target and Output Time Series Data

This example shows how to use a NARX network to solve a time series problem.

[X,T] = simplenarx_dataset;
net = narxnet(1:2,20);
[Xs,Xi,Ai,Ts] = preparets(net,X,{},T);
net = train(net,Xs,Ts,Xi,Ai);

{"String":"Figure Neural Network Training (31-Aug-2022 01:34:39) contains an object of type uigridlayout.","Tex":[],"LaTex":[]}

Y = net(Xs,Xi,Ai);

{"String":"Figure Time-Series Response (plotresponse) contains 2 axes objects. Axes object 1 with title Response of Output Element 1 for Time-Series 1 contains 4 objects of type line. These objects represent Errors, Response, Targets, Outputs. Axes object 2 contains 3 objects of type line. This object represents Targets - Outputs.","Tex":"Response of Output Element 1 for Time-Series 1","LaTex":[]}

Version History

Introduced in R2010b