I am trying to do some operations on color video in MATLAB however, I am facing 2 problems:
I am getting an error while converting color video to grayscale
Your first problem is due to trying to assign the 2D output of rgb2gray into a 3D array. You can fix this by converting the gray image back to RGB format:
frames(:,:,:,i)=repmat(rgb2gray(frames(:,:,:,i)),[1 1 3]);