HI, take a look at the links they sent you . As an alternative answer here is how :
Your fifty images must be labeled in order, per example in the database coil-100 , an object starts from obj1__0 until obj1__355 with step 5 .
Suppose your images are like : image1.jpg, image2.jpg,....., image50.jpg then :
Next wether you create Gif file (imwrite),avifile or any other way, just follow the steps that you can find in the MAT doc .
i Hope this helps .