Hi Lindsay,
Maybe someone can give you more specific information, but for starters there's the "AFNI matlab toolbox" that you can download from the afni site. It has a bunch of functions in it for both reading and writing AFNI datasets from Matlab.
When I use it, I usually read in an existing image and use exactly the same structure (coordinates, voxel dimensions, etc.) for the output so I don't have to think about it, and just overwrite the data values in the voxels with the results of whatever computation that I did in matlab.
If you want to see specific code examples just email me off-list or stop by.
-Jed