Question: Write a C Language Program to Read from a text file, and compute the Mean and Standard Deviation for each column, except the last column
Write a C Language Program to Read from a text file, and compute the Mean and Standard Deviation for each column, except the last column and print the values; Text file is actually an .arff extension file, so each attribute has its respective column. The code should be implemented such that only the numeric data is processed and the the alphabetic text be ignored.
Given below is data inside the text file, (the code should work for any file with different data and variable rows/columns):
@relation mesocyclone
@attribute baseHt real @attribute depth real @attribute coreDepth real @attribute baseDiam real @attribute baseShear real @attribute baseVrot real @attribute baseGTGVD real @attribute maxShear real @attribute maxVrot real @attribute meanStrength real @attribute MaxStrength real @attribute meanReflectivity real @attribute maxReflectivity real @attribute class real
@data 3.649158 6.569605 3.368813 10.550637 1.184763 6.250000 8.500000 1.878885 9.750000 2.000000 1.000000 31.282511 46.643620 0.000000 0.007000 0.631782 0.638782 1.300430 16.532993 10.750000 10.000000 16.532993 10.750000 2.500000 3.000000 1.101431 11.257297 0.000000 0.007000 0.700840 0.707840 1.382040 16.280283 11.250000 15.000000 17.837152 13.250000 3.500000 4.000000 -3.263574 7.225410 0.000000
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
