I'm using two for loops and wants 25 "i"(inner loop) values w.r.t the "j" or X[] values.but it shows something different.plz help me.
this is my code
int X[] = {1,2,3,5,10,20,30,40};
for(int j=0;j<X.length;j++)
{
System.out.println("J: "+j+":"+X[j]);
for (i=0; i < 25; i++)
{
K1[i] = (float) (((C1[i] * (Math.pow(X[j], A1[i]))) + (D1[i] * tanh(X[i]/(Xk1[i] - 2))) - tanh(-2)) / (1 - tanh(-2)));`
System.out.println("k1: "+i+":"+K1[i]);
K2[i] = (float) (((C2[i] * (Math.pow(X[j], A2[i]))) + (D2[i] * tanh(X[i]/(Xk2[i] - 2))) - tanh(-2)) / (1 - tanh(-2)));
System.out.println("k2: "+i+":"+K2[i]);
}
}
and output
J: 0:1
k1: 0:0.77030677
k2: 0:0.71177393
k1: 1:0.85542655
k2: 1:0.7439147
k1: 2:1.0791008
k2: 2:1.4420886
k1: 3:1.4016204
k2: 3:0.99215466
k1: 4:1.6363927
k2: 4:1.1519849
k1: 5:1.8587888
k2: 5:1.2869722
k1: 6:2.1131036
k2: 6:1.4581378
k1: 7:2.2821712
k2: 7:1.5228558
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…