Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- clear;
- x = [0:0.05:1];
- a = 0.1;
- b = 0.36;
- c = 0.81;
- d = 0.15;
- y = a.*x.^3 + b.*x.^2 + c.*x + d
- for i = 1:100
- a = rand;
- b = rand;
- c = rand;
- d = rand;
- T(1,i) = a;
- T(2,i) = b;
- T(3,i) = c;
- T(4,i) = d;
- P(i,:)=a.*x.^3 + b.*x.^2 + c.*x + d;
- end;
- P=P';
- net =newff(minmax(P),[7 4], { 'tansig', 'purelin'},'trainlm');
- net.trainParam.epochs = 500;
- [net] = train(net,P,T);
- K = sim(net,y')
- a = 0.9;
- b = 0.81;
- c = 0.87;
- d = 0.005;
- y1 = a.*x.^3 + b.*x.^2 + c.*x + d;
- K = sim(net,y1')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement