I had to comment out a few lines of the code to make it work, namely line 37 as matlab did not know what ‘ed’ was. Please advise? It also seems as though you have a number of functions for networks in this functions, so i commented out the closed loop function. Essentially I want to predict one step ahead so i am commenting out those functions I do not need. I assume the predicted value is y from line 36?