How to predict next value using time series?

WT · Jun 13, 2022 · 2.4K views
Question
Hi, is there a way to use neural network toolbox to predict the next value in a time series?
Expert Answer
Profile picture of Neeta Dsouza
Neeta Dsouza PhD Expert
Answered Sep 12, 2026
  1. Override 'dividerand' to obtain constant intervals between points. For example

 

net.divideFcn = 'divideblock'

2. Obtain the final states Xf,Af from training

 

[ net tr Ys Es Xf Af] = train(net,Xs,Ts,Xi,Ai);

   %Ys = net(Xs,Xi,Ai); 
   %Es = gsubtract(Ts,Ys);

3. You have to know the new initial state conditions Xinew, Ainew to predict points after the original data; Then

 

   Ynew = net(NaN(n),Xinew,Yinew))

will yield n predictions. If Xinew,Ainew = Xf,Af, then Ynew is a gapless contnuation of Ys.

100% Run Guarantee 3-Hour Fast-Track Delivery

Need a Custom Version or Complete Simulation for This Problem?

Our 500+ PhD engineers build, debug, and optimize working MATLAB scripts and Simulink (.slx) models tailored to your exact assignment rubrics with zero plagiarism.

Tested on MATLAB R2024b / R2026a
Turnitin 0% Plagiarism Report
Free 7-Day Revisions Guarantee
Have a different question? Ask here

Get a Free Consultation or a Sample Assignment Review!