Thank you, ISIONOUS!
I made my own program finally. It can define the order numbers, however, some simple calculation can't go through, like dt, du. I am pulling my hair. Can you help to check?
David
#include "math.h"
#include "MC9S08DZ60.h"
void main(void) {
int i=0,j=0;
float temp_in=16.8;
float pressure_in=5.8;
float temp[]={10.2, 14.7, 17.4, 21.2, 26.7};
float *pa;
float temp1, temp2;
float pressure[]={1.5, 2.7, 3.9, 5.4, 6.9};
float *pb;
float pressure1, pressure2;
float bipt[5][5]={
{4.2, 7.5, 10.9, 14.1, 17.6},
{5.1, 8.1, 12.4, 14.9, 18.7},
{6.7, 9.1, 13.8, 16.7, 20.5},
{7.8, 10.4, 15.4, 18.0, 21.7},
{9.2, 11.2, 16.7, 19.1, 23.2}
};
float *pab;
float t, u, z11, z12, z21, z22,dt, du;
float z_pt;
pa=&temp[0];
pb=&pressure[0];
pab=&bipt[0][0];
if (temp_in>*pa&temp_in<*(pa+4)) {
while (*(pa+i)<temp_in) {
temp1=*(pa+i);
temp2=*(pa+i+1);
i++;
}
while (*(pb+j)<pressure_in){
pressure1=*(pb+j);
pressure2=*(pb+j+1);
j++;
}
t=(temp_in-temp1)/(temp2-temp1);
u=(pressure_in-pressure1)/(pressure2-pressure1);
dt=1-t;
du=1-u;
z22=*(pab+i*5+j);
z11=*(pab+(i-1)*5+(j-1));
z12=*(pab+(i-1)*5+j);
z21=*(pab+i*5+(j-1));
//z_pt=(1-t)*(1-u)*z11+t*(1-u)*z21+t*u*z22+(1-t)*u*z12;
}
for(;;); /* please make sure that you never leave main */
}