Hi Arslan,
I am not sure if I fully understood your requirement.
If your intention is to receive that data in MATLAB, you will find the "system" command of Raspberry Pi support package useful.
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!