急求一段用MATLAB编程的BP神经网路的一阶倒立摆控制程序

2025-01-02 17:13:53
推荐回答(2个)
回答1:

X=[0.26 0.24 -2.5 -2.5;0.235 -0.5 -0.7 0.5;0.11 0.4 -1.7 -0.9;0.14 -0.2 -1.8 2.4 ;0.14 -0.9 2.3 -1.56;0.06 -0.8 1.53 -1.6;0.06 -0.6 0.7 1.73;0.05 -0.18 -0.23 0.6;-0.28 0.76 2.2 1.2;-0.2318 0.23 -2.4 1.7;-0.13 0.66 -0.2 -2.2;-0.13 -0.2 0.57 2.4;-0.13 -0.8 1.8 0.8;-0.06 0.8 -2.5 2.2;-0.07 0.5 -1.4 -0.7;-0.07 0.15 2.3 -0.7]';
T=[-5.99 4.02 -0.95 8.05 -2.99 -7.6 5.98 2.01 8.98 -7.01 -8.49 5 -3.97 7.1 -5.18 3.04];
net=newff(minmax(X),[10 1],{'tansig','purelin'},'trainlm');
net=train(net,X,T);
X1=X;
Y=sim(net,X1);
gensim(net,-1);
.........................................................9号交吧

回答2: