Answer the question
In order to leave comments, you need to log in
How can I skip multiple elements from the array in my case?
There is an array:
public static float MassCurrentsPhases[] = new float[27];
private static float calculatePhase(int i, float[] MassCurrentsPhases) {
return MassCurrentsPhases[0 + i] + MassCurrentsPhases[3 + i] + MassCurrentsPhases[6 + i] + MassCurrentsPhases[9 + i] + MassCurrentsPhases[12 + i]
+ MassCurrentsPhases[15 + i] +MassCurrentsPhases[18 + i] + MassCurrentsPhases[21 + i] + MassCurrentsPhases[24 + i];
}
int i takes the value 0, 1, 2 Answer the question
In order to leave comments, you need to log in
for(int i = b*3; i < b*3+3; ++i) {
data[i] = 0;
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question