how to export angle of bones to csv format?

hi,

I am trying to export the angles of my IK robot arm to a csv file(or txt). I need that because I can then import that data into other programs like matlab.

ty