为了优化我的代码我做了内存分配,但现在我收到了这个错误,请看看它
I(:,:,:,:)=zeros(Height,Width,3,nframes,'uint8');
for i=1:nframes
I(:,:,:,i) = read(xyloObj,i);
end
S=zeros(Height,Width,3,nframes,'uint8');
for i=2:nframes
S(:,:,:,i)=I(:,:,:,i)-I(:,:,:,i-1);
Q(:,:,:,i)=var(double(S(:,:,:,i)));
end