julianfperez
julianfperez

Reputation: 1744

Extract correct data of a file in Matlab

During an integration process with variable stepsize (in concrete, ode113 integrator is used) the position of a body is determined through its acceleration which is stored in a file along with time (i.e. two columns, one for time and the remaining for the acceleration). However, because of there are failed integration steps through the mentioned process, the file for the acceleration data has more rows than the corresponding one for the position data. How I could to extract the correct data of the acceleration data and create a new file for it with the same rows as the position data file?

Upvotes: 0

Views: 194

Answers (1)

anon
anon

Reputation: 26

Is the incorrect data always distributed in a logical way? You can create a search function, looking at the indices of the matrix. Thus cut out the correct data by copying them to a new variable of the now correct length. possibly expensive interms of run time and data storage but definately surefire.

Upvotes: 1

Related Questions