how to get numdate ?
In the example there "Electricity Load Forecasting using Neural Networks" then you have to look at the first line of the example,
data = fetchDBLoadData('2004-01-01', '2008-12-31');
The code for that function is provided as part of the FEX contribution. It connects to a database and retrieves the data from there. So the data.NumDate information is being retrieved from a database.
What function does this line do?
The comparison on the line above
trainInd = data.NumDate < datenum('2008-01-01');
returns a logical vector, one result for every entry in data.NumDate, that is set to true if the date is before that particular datenum, and false otherwise.
is then doing logical indexing, selecting rows of X corresponding to NumDate entries that were before 2008.
what is the logic?
net = newfit(trainX', trainY', 20);
so newfit() is used to create the network. newfit() is documented to be newff() with a plotting function set.
how many hidden layers are used?
When you pass a non-empty value as the third parameter to newfit() or newff() then the number of hidden layers used is one more than the number of entries in the vector. 20 is a vector of length 1, so 2 hidden layers will be used, the first of which will be sized 20 and the second will be whatever size is required by the data.