I'm trying to integrate the use of Phidgets with some Matlab code that I have.
I'm using the 1056_0 spatial 3/3/3 and running Matlab 7.10.0 (2011b) on a windows 7 machine.
Within the Matlab code, I have a loop where I am polling the spatial for acceleration/gyro data. The other functionality in the loop causes each cycle to have a different elapsed execution time so I can't really align the data rate of the spatial with the speed of the loop. This is leading to data integrity issues when the loop takes too long (and misses data packets from the spatial) or when the loop is too quick (and receives redundant data from the spatial)
I'm looking for a way to resolve this and was going to try and use a SpatialEventData struct since it at least has a timestamp but don't even know how I would incorporate this into Matlab code.
Any advice on how I can sync up the data rate so that I'm not missing/double counting data or an example of using the SpatialEventData struct in matlab would be greatly appreciated.