I have forgotten most of the NN stuff and I no longer have a toobbox but, have you tried
[net,tr]=train(net,min_max,f'); ^ adding the ' symbol to transpose the column array to a row array so that it matches the rows of the data?
Also, in newff, I would expect the dimensions to match the data, say [2 1], or better [2 5 1], or is this done automatically? I can't find documentation for newff.
Sorry I'm not more current.