Consider this STATIC APPROXIMATOR to the OL (Open Loop) NARXNET:
clear all, close all,clc, plt=0
[ INPUT TARGET ] = simplenarx_dataset;
input = cell2mat(INPUT);
target = cell2mat(TARGET);
[ I N ] = size(input) % [ 1 100 ]
[ O N ] = size(target) % [ 1 100 ]
plt = plt+1, figure(plt), hold on
plot( input, 'k', 'LineWidth', 2 )
plot( target, 'b', 'LineWidth', 2 )
net0 = narxnet(1:2,1:2,10); % default OL time-series configuration
net = fitnet(10); % static OL approximator
x = [ input(1:end-2);input(2:end-1); ...
target(1:end-2); target(2:end-1)];
t = target(3:end);
rng(4151941)
[ net tr y e ] = train(net,x,t );
NMSE = mse(e)/var(t',1) % 3.1731e-07
Rsq = 1 - NMSE % 1
plt = plt+1, figure(plt), hold on
plot( 1:N-2, x, 'k', 'LineWidth',2)
plot( 3:N, t, 'b', 'LineWidth',2)
plot( 3:N, y, 'ro', 'LineWidth',2)
legend('INPUT', 'TARGET','OUTPUT')
Hope this helps.
Thank you for formally accepting my answer
Greg
PS: It seems to me that a STEPWISE QUASI-STATIC APPROXIMATOR to the CL (Closed Loop) NARXNET should be possible by using the function ADAPT (or even TRAIN?) in a loop that uses y(n-2:n-1) to predict y(n).