How can I create AVI movie file from a set of 3d (and 4d matrices) in Matlab on Windows 7?

1.3k views Asked by At

I have 2 matrices; one 3d matrix its size is for example (100* 400 * 90 ; (90 is time)) and also I have a 4 dimension matrix. I want to make AVI file for both of them separately. unfortunately, each code I found via Internet couldn't run properly. Hope your knowledge can help me. i tried with aviobj and mov2avi .... but I couldn't get answer.

Edit

I want to make AVI file based on a 420*320*3*90 matrix

Could anyone tell me how can I make an AVI video from RGB Images?

1

There are 1 answers

0
Heaven On

I found the answer: how to make AVI video file for RGB images:

mov(1:num_frames) = struct('cdata', [],'colormap', []);


for i=1:90
    ..
    mov(1,i).cdata=rgb(:,:,:,i);
    ..
end
movie2avi(mov, 'RGB.avi', 'compression', 'None');