English 中文(简体)
Matlab-Neural Network Simulation (for Loop)
原标题:Matlab -Neural Network Simulation (for Loop)

下面,我是新qui子,用于配对有线电视网的工具箱,并建立了以下有线电视网:

val.P=Exp;

net =newff(minmax(p),[20,3],{ tansig , purelin }, trainlm );

net.trainParam.epochs = 5000;    %Max Ephocs
net.trainParam.goal = 1e-5;     %Training Goal in Mean Sqared Error
net.trainParam.min_grad = 0.05e-3;
net.trainParam.show = 50;       %# of ephocs in display
net.trainParam.max_fail =20;
net = init(net);

[net,tr]=train(net,p,t,[],[],val);
o1 = sim(net,Exp)

How can I run the above for say 20 times and store the data in one variable (o1)? Any help is very much appreciated !

最佳回答
for iteration=1:20
  % Your NN code
  [net, tr]=train(net,p,t,[],[],val);
  o1(:,iteration) = sim(net,Exp);
end

之后,<代码>o1将成为一阵列,其所有结果均载于其中。

注: 我不了解你的数据的方面,你可能需要修改第1条(煽动)或第1条(:煽动)等。 不管你们需要什么。

问题回答

暂无回答




相关问题
as2 simple for loop not populating textbox

I have got an xml file that brings text into a flash movie in the form of an array, I need to population some textboxes and want to do this using a for loop. My loop look like this: for(var i=...

Undirected (Multi) Graph (Hierholzers Algorithm)

I am very stuck with the looping structure for my graph to work out Eulers tour. This is the graph I am drawing, remember it s undirected, so a journey from N1 to N4 is the same as a journey from N4 ...

Smarty Section Making the selected Link Bold

How can I make the selected link from the List below, bold, that you see you are on Page ex. 3 or 5 With this code, If you click on a Link you don t know on which page you are. The smarty code ...

Back button loop with IFRAMES

In my (school) website we use Iframes to display class blogs (on blogger). This works well EXCEPT if the user then clicks on (say) a photo inside the iframe. Blogger (in this case) then displays the ...

Handling multiple windows WIN32 API

HI I m trying to create an application in the Win32 environment containing more than one window. How do i do that? all the Win32 Tutorials on web i found only showed how to manage one window. How do i ...

Saving output of a for-loop to file

I have opened a file with blast results and printed out the hits in fasta format to the screen. The code looks like this: result_handle = open("/Users/jonbra/Desktop/my_blast.xml") from Bio.Blast ...

热门标签