這裏是我的MATLAB代碼:爲什麼Matlab顯示「索引超出矩陣尺寸」?
gg=imread('fsu_Westcott.jpg');
data1=gg(:,1);
histArray1=zeros(1,256);
x=0:1:255;
for n=1:length(data1)
histArray1(1,data1(n)+1)=histArray1(1,data1(n)+1)+1;
end
for n=1:length(data1)
number1=sum(histArray1(1:n));
end
plot(x,number1,'r')
爲什麼顯示 「指數超過矩陣尺寸。」?在我終於劇情之前?我是新的,並提前感謝! :)