MATLAB: Error using preparets with narxnet

neural networkpreparets

I'm trying to use a closed loop narxnet for some time series prediction, but I'm having trouble getting past the preparets step.
My network is 2 inputs, 1 feedback target
view(net) shows this is correct
However this code throws an error. As far as I can tell, my input/target cell arrays are the size they should be to match the configured network.
% dummy data
X = rand(2,100);
T = rand(1,100);
% set up network
net = narxnet(1:2,1:2,5);
net = closeloop(net);
net = configure(net,X,T);
% Net shows 2 inputs 1 output
view(net)
% convert to cells
X = num2cell(X); % X is 2x100
T = num2cell(T); % T is 1x100
% Here's the problem
[Xs,Xi,Ai,Ts] = preparets(net,X,{},T);
Thanks in advance

Best Answer

Nm, I got it myself. For those with similar problems, you need to use con2seq to turn your input/output matrices into input/output sequential vectors. No idea where you are supposed to read about this step in the documentation, and it seems like something that can be easily handled behind the scenes without having to confuse users.
These days I work with a lot of ML and AI experts, and they laugh at me for insisting on using matlab for everything. I'm starting to think they have a point.
% Instead of:
% X = num2cell(X); % X is 2x100
% T = num2cell(T); % T is 1x100
% Use:
X = con2seq(X);
T = con2seq(T);
Related Question