![]() |
神经网络,matlab编程
我该如何解决我的程序中的此错误(学习网络)?它出现在sim之后。互联网。
Error in ==> network.sim>simargs at 236 switch class(P) ??? Output argument "Pi" (and maybe others) not assigned during call to "C:\Program Files\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}) [B]回答:[/B] [I]注意:[/I]不要陷入与我相同的陷阱。 [URL="http://www.mathworks.com/products/simulink/"]Simulink[/URL]中还有一个名为[URL="http://www.mathworks.com/help/toolbox/simulink/slref/sim.html"]SIM[/URL]的功能,可能会在[URL="http://www.mathworks.com/products/neuralnet/"]神经网络工具箱[/URL]中搜索功能[URL="http://www.mathworks.com/help/toolbox/nnet/sim.html"]SIM[/URL]时显示。 我要检查的第一件事是第二个输入参数A{1,1}的格式正确。具体来说, A{1,1}必须是[URL="http://www.mathworks.com/help/techdoc/matlab_prog/br04bw6-98.html"]单元格数组[/URL]或[URL="http://www.mathworks.com/help/techdoc/matlab_prog/f2-12135.html#f2-101310"]double[/URL]的矩阵。如果它采用任何其他形式,例如[URL="http://www.mathworks.com/help/techdoc/matlab_prog/f2-12135.html"]任何[/URL] [URL="http://www.mathworks.com/help/techdoc/matlab_prog/f2-97022.html"]其他[/URL] [URL="http://www.mathworks.com/help/techdoc/matlab_prog/f2-47856.html"]类[/URL]的[URL="http://www.mathworks.com/help/techdoc/matlab_prog/br04bw6-38.html"]结构[/URL]或矩阵,您将收到所看到的错误。诚然,子函数simargs不能很好地处理此特定错误,因为它会为您提供一些无法真正告诉您基本问题的隐秘消息,即您的输入格式不正确。 这里有几件事要检查: [LIST][*]您是真的要传递[I]单元[/I]格数组A的[I]第一个元素[/I]作为输入参数,还是要简单地传递单元格数组本身?如果是第二个选项,请执行以下操作: y = sim(net,A);[*]如果[I]确实[/I]要传递A的第一个元素作为输入参数,请使用[URL="http://www.mathworks.com/help/techdoc/ref/class.html"]CLASS[/URL]函数仔细检查它的类: class(A{1,1}) 如果没有看到double显示,则表示A的第一个元素不是正确的类型。如果是矩阵,则可以[URL="http://www.mathworks.com/help/techdoc/ref/double.html"]将其转换为double,[/URL]然后[URL="http://www.mathworks.com/help/techdoc/ref/double.html"]再将其[/URL]传递给[URL="http://www.mathworks.com/help/toolbox/nnet/sim.html"]SIM,[/URL]如下所示: y = sim(net,double(A{1,1}));[/LIST] [url=https://stackoverflow.com/questions/4573722]更多&回答...[/url] |
所有时间均为北京时间。现在的时间是 23:25。 |
Powered by vBulletin
版权所有 ©2000 - 2025,Jelsoft Enterprises Ltd.