[請問]使用 MATLAB 作FOR迴圈統計

看板AVEncode作者 (酷哥)時間18年前 (2007/05/08 17:31), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串1/1
command Window >> fig=imread('cameraman.tif '); imshow(fig); [m,n]=size(fig); histogram=zeros(1,256); for i=1:m for j=1:n gray=fig(i,j); histogram(1,gray+1)=histogram(1,gray+1)+1; <這行是什麼意思?> end end plot(histogram); 另外這個是做彩色的R G B分離統計,但是我沒辦法寫在一起R G B都要各寫一次,很麻煩請 各位大大幫我 command Window >> fig=imread('autumn.tif'); R=fig(:,:,1); [m,n]=size(R); histogram=zeros(1,256); for i=1:m for j=1:n gray=R(i,j); histogram(1,gray+1)=histogram(1,gray+1)+1; end end plot(histogram); -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 220.141.4.1
文章代碼(AID): #16G4ED-Q (AVEncode)