I am new to Matlab. Mlint tells that I need to preallocate the arrays to improve performance.Can anyone tell me how do I preallocate array size in following code snippet:
for jj= init_frame: nFrames
im1 = double(mov(jj).cdata);
color_hist_array(jj,:) = color_histogram(im1, bins);
[spatio_gram_array(jj,:),mu(jj,:,:),sigma(jj,:,:,:)] = spatiogram(im1, bins);
Preallocation needs to be done in color_hist_array, spatio_gram_array, mu and sigma.