float a1[20][2]={-3.3687,-5.2968,0.1708,-7.8082,5.4965,0.1422,-3.7267,3.1903,5.3749,0.1737,
-2.8640,-5.2036,-7.9707,1.6093,-4.2137,4.0974,0.5579,0.0077,-0.3016,6.2936,-4.5788,3.8371,
-1.6259,-6.4366,1.2259,4.8071,-4.2045,-2.2770,3.9083,-3.7246,-7.0393,2.2410,4.1461,0.0702,
-5.6493,-1.9123,3.2881,2.3882, -4.0469,2.3681,
};
float a3[20][1],a4[20][1],a5[20][1],a2[20][1]={0.0001,0.0006,0.0595,-0.0007,0.0198,0.0012,0.0001,
-0.0016,1.8196,-0.0000,0.0009,-0.0014,-0.0029,-0.0001,
-0.0001,-0.0004,0.0373,-0.0001,-0.0023,0.0175,};
float b1[20][1]={5.7345,5.1927,-4.5743,3.8727,-2.2433,2.3383,2.4291,
1.8239,0.1060,1.7029,0.1535,-1.8653,1.4944,-2.0887,
1.7663,-3.2747,3.7495,-4.3614,4.8086,-7.7335,};
float a6,a7,b2=-0.1287;
for(i=0;i<20;i++)
{
a3[i][0]=a1[i][0]*zl+a1[i][1]*wd; //温度----wd;重量-----zl
}
for(i=0;i<20;i++)
{
a4[i][0]=a3[i][0]+b1[i][0];
}
for(i=0;i<20;i++)
{
a5[i][0]=2/(1+exp(-2*a4[i][0]))-1;
}
for(i=0;i<20;i++)
{
a6+=a2[i][0]*a5[i][0];
}
a7=a6+b2;
这个程序能实现么,我再430单片机中实现的时候出现了,数值基本上都在1左右变化,是不是我的数组里面的值太小,如果我想放大数值可行么?
|