Once you are done building your scenario, place a sensor on your Actor, change the 'Update Interval (ms)' as required and run the scenario. Then click 'Export -> Export Sensor Data' . In the dialogue box that appears, give a variable name to which you want to save the data and click OK. The data gets saved to the MATLAB base workspace. The yaw angles can be accessed as a vector by using a for loop.
For example, after 'Export Sensor Data' is clicked, I saved the data as 'sensor_data' as follows:
Now to get the yaw angles as a vector, a for loop can be written as:
-39.3675 -38.8738 -10.8638 32.5091 -6.1386 -36.1907