From: Lead Bucket on
I have struggled with this same issue. After exploring the dicomwrite function a bit, it looks like the functionality is there for a multiframe dicomwrite, but its just not activated (at least as of my version which is R2008b). To get a multiframe write to a single file, I had to modify the private function dicom_encode_jpeg_lossy.m (and any other encoding function I planned on using - there seemed to be 3 provided) to cycle through the multiple frames (they are currently set to implement only a single frame). Second, I had to modify dicomwrite.m to remove the for loop associated with the multiple frames along with the three lines that had dependencies on the loop variable p (the dicom_create_IOD function call, the dicom_copy_IOD function call, and the get_filename function call which I just changed to destination = filename;).

The rest of the functionality for a multiframe write is there, so once you implement the above changes, it seems to work fine. I'm no expert on dicom format and I don't know if the resulting dicom file meets dicom specs, but all I needed was the data and not the remaining dicom info, so this worked for me.