Incremental optical encoder output to Matlab Simulink
You could use the Matlab Data Acquisition Toolbox, if you have access to that.  

Alternately, a digital storage oscilloscope may be about to capture data in some kind of spreadsheet format that you could easily import into Matlab.

You will need to set the sampling rate high enough to avoid aliasing.  For a conventional rotary encoder, that the critical time is about 0.5 ms, so you need to sample at 0.25 ms or less (4000 Hz).  You'll need to ensure your data capture system is properly configured to capture these events.  For your optical encoder, the sample time will be related to the maximum speed you are trying to capture and the number of positions in the encoder.