how to convert this to r2013 a code

1 次查看(过去 30 天)
how to convert this to r2013 a code:
clear tempP
for k = 1:500,
P = [theta(k);psi(k);theta_dot(k);psi_dot(k)];
tempP = [tempP P];
end
net= newff([-2 2;-2 2;-2 2;-2 2],[50 1],{'tansig','purelin'},'trainlm');
net.trainParam.epochs = 500;
net = train(net,tempP,out(1:500)');

采纳的回答

Greg Heath
Greg Heath 2014-11-29
1. This is MATLAB, a MATtrix LAnguage. Typically, loops are unnecessary. If theta, etc are row vectors, use
P = [ theta; psi; theta_dot; psi_dot];
otherwise transpose them before forming P.
2. The target should neither be named out nor should it be a column vector. It should be a row vector named Target or T
[ I N ] = size(P); % [ 4 500 ]
[ O N ] = size(T); % [ 1 500 ]
3. The input syntax you used with NEWFF is DOUBLY obsolete; i.e.,
net = net( minmax(P), [ H O ]);
where the remaining 3 inputs were OMITTED since they are defaults.
4. This newer version is also obsolete:
net = net( P, T, H);
5. NEWFIT (regression)and NEWPR (classification) automatically call NEWFF; ALL are obsolete and have been replaced by FITNET(regression), PATTERNNET(classification) and FEEDFORWARDNET, respectively.
6. To find the correct syntax for your regression problem use the commands
help fitnet
doc fitnet
7. For oogobs of examples, search both the NEWSGROUP and ANSWERS using
greg fitnet.
Hope this helps.
Thank you for formerly accepting my answer
Greg

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Sequence and Numeric Feature Data Workflows 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by