Error using subsindex
Function ‘subsindex’ is not defined for values of class
‘network’.
Error in feedforward (line 4)
net = train(net,traindata,t_lable);
变量列表中存在名字为train的变量,所以导致程序无法识别,修改变量名称由train改成train_test,然后再次调用train函数即可。
学习借鉴处:
http://cn.mathworks.com/matlabcentral/newsreader/view_thread/259336
net = train(net,p,t); <——————–Error here
y=sim(net,p);By the way,
train is 5000x784 double
You’re trying to call the TRAIN function on the network; however, since
there exists a train variable in the workspace the line where the error
occurs is considered to be an attempt to index into the train variable
rather than a call to the TRAIN function. However, MATLAB does not know how
to use a neural network to index into a variable, so you receive that error.
Rename or delete the train variable and that call should work as a call to
the function rather than an attempt to index into the variable.