[Freesurfer] using matlab loops for MRIwrite