Pixhawk 4 mini

Hello all,
I am a research student with Mechanical Engineering background, Working on a problem where i need real time data logging from the pixhawk 4 mini to the base station (my laptop with Qground control), I need to use the GPS info from the FC module in a matlab script to output the GPS info in an excel sheet all real time, please let me how to establish this kind of system, my quad copter uses pixhawk 4 mini, Thank you in advance.