开发者

neural network,matlab programming

what can i do to solve this error in my program(learning the net)? it appear after sim. the net.

Error in ==> network.sim>simargs at 236
switch class(P)

??? Output argument "Pi" (and maybe others) not assigned during call to "C:\Program
Files开发者_Python百科\MATLAB\R2008b\toolbox\nnet\nnet\@network\sim.m>simargs".

Error in ==> network.sim at 173
  case 2, [err,X,Xi,Ai,T,Q,TS,matrixForm] = simargs(net,X);

Error in ==> mlptrptest at 62
y = sim(net,A{1,1})


Note: Don't fall into the same trap I did. There is also a function called SIM in Simulink that will likely show up in searches for the function SIM in the Neural Network Toolbox...

The first thing I would check is that the second input argument A{1,1} is of the correct form. Specifically, A{1,1} would have to be a cell array or a matrix of doubles. If it is of any other form, like a structure or a matrix of any other class, you will get the error you are seeing. Admittedly, this particular error isn't handled very well by the subfunction simargs, in that it gives you some cryptic messages that don't really tell you the basic problem, which is that your input is not in the right format.

Here are a couple things to check:

  • Do you really mean to pass the first element of cell array A as an input argument, or do you mean to simply pass the cell array itself? If it's the second option, just do this:

    y = sim(net,A);
    
  • If you do mean to pass the first element of A as an input argument, double-check it's class using the function CLASS:

    class(A{1,1})
    

    If you don't see double displayed, it means the first element of A is not the right type. If it is a matrix, you can convert it to double before you pass it to SIM like so:

    y = sim(net,double(A{1,1}));
    
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜