Guide to gyro and accelerometer with Arduino including Kalman filtering

To be honest I really don't know. It's pretty complex mathematics. I just found a kalman filter used by another Arduino user (he also got it from some place else). But yes it represents a matrix.