Hi mafia_ir,
Iassumewhat you are trying to do is to capture the digital signals, write them to a file that can be accessed by matlab.
I'm afraid a mere Arduino won't have enough horsepower this task.
Have you considered using an FPGA and writing some VHDL code?
Pat.