I have a matrix [99] [2] that stores the data in a txt with a number of two columns, another of the same size that assigns a variable for each interval in which the ex numbers are:
0 - 0.25 assigns variable A and E respectively.
0.25 - 0.5 assigns variable B and F
0.5 - 0.75 assigns variable C and G,
0.75 - 1 assigns variable D and H.
ABCD for the first column, and EFGH for the second, and at the end it brings me an account of how many A's, B's, C's, ..., D's were found.
my problem is in the interval 0.75 - 1.0, I have created a variable SA (unassigned, so that it stores the number of numbers that are not in the range, which brings me those that should be in D and H.] matrix [] [] stores the numbers of the txt , Variables [] [] use to assign variables if they are in the range.
This is a sample of the output of the program:
A = 27
B = 22
C = 24
D = 0
E = 27
F = 23
G = 24
H = 0
SA = 51
The code I'm working with is the following:
for(int filas=0;filas<matriz.length;filas++){
for(int columnas=0;columnas<matriz[filas].length;columnas++){
if((matriz[filas][0]>0)&&(matriz[filas][0]<0.25)){
variables[filas][0]="A";
A++;
} else if((matriz[filas][0]>=0.25)&&(matriz[filas][0]<0.5)) {
variables[filas][0]="B";
B++;
} else if((matriz[filas][0]>=0.5)&&(matriz[filas][0]<0.75)) {
variables[filas][0]="C";
C++;
}else if((matriz[filas][0]>=0.75)&&(matriz[filas][0]<0.1)) {
variables[filas][0]="D";
D++;
} else {
variables[filas][0]= "sin asignar";
SA++;
}
if((matriz[filas][1]>0)&&(matriz[filas][1]<0.25)){
variables[filas][1]="E";
E++;
} else if((matriz[filas][1]>=0.25)&&(matriz[filas][1]<0.5)) {
variables[filas][1]="F";
F++;
} else if((matriz[filas][1]>=0.5)&&(matriz[filas][1]<0.75)) {
variables[filas][1]="G";
G++;
}else if((matriz[filas][1]>=0.75)&&(matriz[filas][1]<0.1)) {
variables[filas][1]="H";
H++;
} else {
variables[filas][1]= "sin asignar";
SA++;
}
I have another similar cycle that takes the count of the variables A - E .... D - H if they are in the same row but the same. since there is no varaiable D or H, it does not show me anything for the combinations of these variables.
I'm grateful if you can help me out.