Generate a matrix containing all combinations of elements taken from n vectors

The ndgrid function almost gives the answer, but has one caveat: n output variables must be explicitly defined to call it. Since n is arbitrary, the best way is to use a comma-separated list (generated from a cell array with ncells) to serve as output. The resulting n matrices are then concatenated into the desired … Read more

How to use onSensorChanged sensor data in combination with OpenGL

I couldn’t test the code yet (but I will, looks really interesting). One thing that caught my attention is that you don’t seem to filter the sensor data in any way. Sensor readings are very noisy by nature, specially the magnetic sensor. I’d suggest you implement some low pass filtering. See my previous answer for … Read more

Deprecation status of the NumPy matrix class

tl; dr: the numpy.matrix class is getting deprecated. There are some high-profile libraries that depend on the class as a dependency (the largest one being scipy.sparse) which hinders proper short-term deprecation of the class, but users are strongly encouraged to use the ndarray class (usually created using the numpy.array convenience function) instead. With the introduction … Read more