end S2=round(S1*256); Error:Missing MATLAB operator.S1=zeros(1,256);for i=1:256 for j=1:i S1(i)=GP(j)+S1(i); %计算Sk end end S2=round(S1*256); %将Sk归到相近级的灰度for i=1:256 GPeq(i)=sum(GP(find(S2==i))); %计算现有每个灰度级出

来源:学生作业帮助网 编辑:作业帮 时间:2024/11/05 19:34:16
end S2=round(S1*256); Error:Missing MATLAB operator.S1=zeros(1,256);for i=1:256 for j=1:i S1(i)=GP(j)+S1(i); %计算Sk end end S2=round(S1*256); %将Sk归到相近级的灰度for i=1:256 GPeq(i)=sum(GP(find(S2==i))); %计算现有每个灰度级出
xOP &Ql,-QnH6Qc3DАb̬3=my_c$d>4s/eSVK9Z䮤7ItcOȺ.hfݩH$- O%4dž*FMZF"Gˌ0=K/0W$Jw!.|Xeqzkbyٟs aYQ`f^dR 3̩WkSsprÍca@q 9O]!qH/ae1}ؤrц4h@е:FVt>J")&zdsBS,'qEjmzv.j(R<J6ڠ}=gT ҤM.ZoqWW~.1tW?!g.wn$"t=X37G|.?C݈xa-riCMI]2

end S2=round(S1*256); Error:Missing MATLAB operator.S1=zeros(1,256);for i=1:256 for j=1:i S1(i)=GP(j)+S1(i); %计算Sk end end S2=round(S1*256); %将Sk归到相近级的灰度for i=1:256 GPeq(i)=sum(GP(find(S2==i))); %计算现有每个灰度级出
end S2=round(S1*256); Error:Missing MATLAB operator.
S1=zeros(1,256);
for i=1:256 for j=1:i S1(i)=GP(j)+S1(i); %计算Sk
end
end S2=round(S1*256); %将Sk归到相近级的灰度
for i=1:256 GPeq(i)=sum(GP(find(S2==i))); %计算现有每个灰度级出现的概率
end
figure,bar(0:255,GPeq,'b') %显示均衡化后的直方图 figure NO 4
title('均衡化后的直方图')
xlabel('灰度值')
ylabel('出现概率')
figure,plot(0:255,S2,'r') %显示灰度变化曲线 figure NO 5
legend('灰度变化曲线')
xlabel('原图像灰度级')
ylabel('均衡化后灰度级')
end S2=round(S1*256); %将Sk归到相近级的灰度
|
Error:Missing MATLAB operator.
哪里出错了?

end S2=round(S1*256); Error:Missing MATLAB operator.S1=zeros(1,256);for i=1:256 for j=1:i S1(i)=GP(j)+S1(i); %计算Sk end end S2=round(S1*256); %将Sk归到相近级的灰度for i=1:256 GPeq(i)=sum(GP(find(S2==i))); %计算现有每个灰度级出
你把这一行end S2=round(S1*256); %将Sk归到相近级的灰度
写成:
end
S2=round(S1*256);%将Sk归到相近级的灰度
试试,好像end不能和其他语句在同一行的.
其他地方没有错,