I have an issue getting my code to work. The following code shown is the function I am using to calculate the RMS of data I have collected from a CFD simulation. I want to read from a file called dynamics.txt that is on my desktop. Below the code I included a couple lines from the text file. The columns of the file are as follows: time, x force, y force, z force, x moment, y moment, z moment, pitch, roll, yaw. I am only concerned with the time and x force... hence the other values being put into the variable g. You may need to make the window larger for the text in the code and data file to look neat and readable.
Any help would be great, thanks!
double RMS()
{
int i(0);
double time(0), drag(0), g, rms;
long double sumsq(0);
bool collect = false;
ifstream fin;