Hi,
I'm trying to write a program that will take and read data from an outside file. I can open the file and all that and get values from the file. The file is a list of times, altitudes, velocities, and accelerations. I need to figure out how to find when the velocity changes from decreasing to increasing and output the time when this occurs. I figured out how to do this using the acceleration. For my data it is every time the acceleration changes from negative to positive. Therefore I used an if statement to say to output the time when acceleration is positive. This doesnt work however because I only need that single value when it changes. With the way I did it, I output the time for every all positive acceleration data points, not just the ones for when the acceleration changes from negative to positive. I've tried switch, for, while, if-else, everything I can think of. Is there any way to just use the first positive acceleration and have the program skip all the other positive accelerations in the data file until the data changes from negative to positive again??
I'm trying to write a program that will take and read data from an outside file. I can open the file and all that and get values from the file. The file is a list of times, altitudes, velocities, and accelerations. I need to figure out how to find when the velocity changes from decreasing to increasing and output the time when this occurs. I figured out how to do this using the acceleration. For my data it is every time the acceleration changes from negative to positive. Therefore I used an if statement to say to output the time when acceleration is positive. This doesnt work however because I only need that single value when it changes. With the way I did it, I output the time for every all positive acceleration data points, not just the ones for when the acceleration changes from negative to positive. I've tried switch, for, while, if-else, everything I can think of. Is there any way to just use the first positive acceleration and have the program skip all the other positive accelerations in the data file until the data changes from negative to positive again??