essentially I have a matrix of form (20,20). The numbers within this array range from 0 to 2.00, my aim is to set a display value for specific ranges (i.e. 0-0.4 will be displayed as "1", 0.4-0.8 will be displayed as "2"... 1.6-2.0 will be displayed as "5".) However, I am struggling to make this work, my code for this specific section is as follows:
//set display values for classification map
{
if(rawData[rowIndex][columnIndex]<=0.4)
printf("1");
else if(rawData[rowIndex][columnIndex]<=0.8)
printf("2");
else if(rawData[rowIndex][columnIndex]<=1.2)
printf("3");
else if(rawData[rowIndex][columnIndex]<=1.6)
printf("4");
else if(rawData[rowIndex][columnIndex]<=2.0)
printf("5");
else printf("ERROR");
}
printf("\n");
}
}
Thanks to any responses :) I am extremely new to programming so any help is much appreciated!!