Documentation 
Kstep ahead prediction
yp = predict(sys,data,K)
yp = predict(sys,data,K,opt)
[yp,x0e,sys_pred]
= predict(sys,data,K,___)
predict(sys,data,K___)
yp = predict(sys,data,K) predicts the output of an identified model, sys, K steps ahead using inputoutput data history from data.
yp = predict(sys,data,K,opt) predicts the output using the option set opt to configure prediction behavior.
[yp,x0e,sys_pred] = predict(sys,data,K,___) also returns the estimated initial state, x0e, and a predictor system, sys_pred.
predict(sys,data,K___) plots the predicted output.
An important use of predict is to evaluate a model's properties in the midfrequency range. Simulation with sim (which conceptually corresponds to k = inf) can lead to diverging outputs. Such divergence occurs because sim emphasizes the lowfrequency behavior. One stepahead prediction is not a powerful test of the model's properties, because the highfrequency behavior is stressed. The trivial predictor $$\widehat{y}(t)=y(t1)$$ can give good predictions in case the sampling of the data is fast.
Another important use of predict is to evaluate timeseries models. The natural way of studying a timeseries model's ability to reproduce observations is to compare its k stepahead predictions with actual data.
For OutputError models, there is no difference between the k stepahead predictions and the simulated output. This lack of difference occurs because, by definition, OutputError models only use past inputs to predict future outputs.
predict predicts the response over the time span of data. forecast performs prediction into the unseen future, which is a time range beyond the last instant of measured data. predict is a tool for validating the quality of an estimated model. Use predict to determine if the prediction result matches the observed response in data.OutputData. If sys is a good prediction model, consider using it with forecast (only supports linear models).
sys 
Identified model. sys may be a linear or nonlinear identified model. 
data 
Measured inputoutput data. Specify data as an iddata object. If sys is a timeseries model, which has no input signals, then specify data as an iddata object with no inputs, or a matrix of past (already observed) timeseries data. 
K 
Prediction horizon. Specify K as a positive integer that is a multiple of the data sampletime. To obtain a pure simulation of the system, specify K as Inf. Default: 1 
opt 
Prediction options. opt is an option set, created using predictOptions, that specifies options including:

yp 
Predicted output. yp is an iddata object. The OutputData property stores the values of the predicted output. Outputs up to the time tK and inputs up to the time instant t are used to predict the output at the time instant t. The time variable takes values in the range represented by data.SamplingInstants. When K = Inf, the predicted output is a pure simulation of the system. For multiexperiment data, yp contains a predicted data set for each experiment. The time span of the predicted outputs matches that of the observed data. When sys is specified using an idnlhw or idnlgrey model, yp is the same as the simulated response computed using data.InputData as input. 
x0e 
Estimated initial states. 
sys_pred 
Predictor system. sys_pred is a dynamic system whose simulation, using [data.OutputData data.InputData] as input, yields yp.OutputData as the output. For discretetime data, sys_pred is always a discretetime model. For multiexperiment data, sys_pred is an array of models, with one entry for each experiment. When sys is a nonlinear model, sys_pred is []. 