Soldato
- Joined
- 10 Apr 2004
- Posts
- 13,489
Im running an app simulating a aircraft in flight, and thus it has numerous variables being calculated and so on.
As it is running a timestep interval of 0.01 seconds, in a 7 hour "flight" that's a lot of data (About 50.4 million pieces!)
I'd like to write certain variables (speed, altitude, etc) to a file so I can import it to excel and plot a graph of it.
How can I tell it to do this every say, second? Or 10 seconds?
An if statement like so:
if (time = integer){
fprintf=...
}
But how do I go about the if (time=multiple of 1/10/100?)
Also, as the flight is broken up into individual sections (takeoff, landing, cruise) I assume I just amend the file, not create a new one? Using "a" on fopen?
Cheers
As it is running a timestep interval of 0.01 seconds, in a 7 hour "flight" that's a lot of data (About 50.4 million pieces!)
I'd like to write certain variables (speed, altitude, etc) to a file so I can import it to excel and plot a graph of it.
How can I tell it to do this every say, second? Or 10 seconds?
An if statement like so:
if (time = integer){
fprintf=...
}
But how do I go about the if (time=multiple of 1/10/100?)
Also, as the flight is broken up into individual sections (takeoff, landing, cruise) I assume I just amend the file, not create a new one? Using "a" on fopen?
Cheers