clc close all %p=[B-force Elong tenacity CVm thin-40% thick+35% neps+200% H % yarn1 ... % yarn2 ... % ... ]% %cotten=1 pv=2% p=[0.427 0.381 0.326 0.26 0.413 0.29 0.256 0.26 0.29 0.254 0.26 0.29 0.253 0.297 0.296 0.295 0.294 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 0 0 0 1 1 1 1 0 0 0 0 0 0 0 0 0 0 1 1 1 0 0 0 0 6 5 4 3 3 0 0 3 0 0 3 0 0 0 0 0 0 0 0 0 0 0 3 0 0 3 0 0 3 0 3 3 3 3 0 0 0 0 0 0 3 0 0 3 0 0 3 0 0 0 0 ]; tt=[3.19 3.75 5.52 7.96 1.38 8.7 16.26 7.06 7.76 11.7 3.506 6.04 6.27 7.82 10.23 10.28 11.58 1.15 1.52 2.58 3.79 0.44 3.42 7.47 2.57 3.07 4.77 1.27 1.55 2.24 3.23 3.55 4.115 4.47 2.2 2.9 5.04 7.39 0.83 9.16 19.495 6.35 8.67 14.35 3.08 4.47 5.59 10.857 11.43 13.226 15.33 38.2 44.2 62.43 79.5 15.2 105.6 186.47 82 92.78 120.34 51.08 70 96.03 105.95 114 119.11 128 ]; t=tt; pnew=p;tnew=t ; [pn,minp,maxp,tn,mint,maxt] = premnmx(p,t); net = newff(minmax(pn),[7,6,4],{'tansig' 'logsig' 'purelin'},'trainlm'); net.trainParam.show = 50; net.trainParam.lr = 0.01; net.performFcn = 'mse'; net.trainParam.mc =.9; net.trainParam.epochs = 2000; net.trainParam.goal =0; [net,tr]=train(net,pn,tn) an = sim(net,pn); a = postmnmx(an,mint,maxt); pnewn = tramnmx(pnew,minp,maxp); anewn = sim(net,pnewn); anew = postmnmx(anewn,mint,maxt); figure; [m,b,r] = postreg(a,t); figure; [m,b,r] = postreg(anew,tnew); weight1=net.IW{1,1}; bies1=net.b{1}; weight2=net.LW{2,1};weight3= net.LW{3,2}; bies2=net.b{2};bies3=net.b{3};