An alternative is to export it out in market matrix file format maintained by NIST:
*dmat, exportmatrix, D, import, APDL, c ! export to matrix file
*export, exportmatrix, mmf, mytemp.mtx
You can then read it in Matlab (and Octave?) using mmread.m found here.
After you have the function in...