Thank you for your reply. I upgraded to the newest version of Matlab and it works.
However, I would like to ask you this simple question. I have two volumes V1 (sphere) and V2 (cube). V2 is smaller than V1. I am using the "registervolumes.m" to register V2 over V1 . The output shows the final registered volumes and that is only the sphere. My question is how I could access volume V2 as it deforms to V1 on each iteration.