zhangqi415
2017-09-18 13:28 阅读 1.9k

怎么让下面的MATLAB程序输出结果

function s=subim(f,4,4,2,2)
%SUBIM Extracts a subimage,s,from a given image,f.
%The subimage is of size m-by-n,and the coordinates
%of its top,left corner are(rx,cy).
s=zeros(m,n);
rowhigh=rx+m-1;
colhigh=cy+n-1;
xcount=0;
for r=rx:rowhigh
xcount=xcount+1;
ycount=0;
for c=cy:colhigh
ycount=ycount+1;
s(xcount,ycount)=f(r,c);
end
end

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享

相关推荐