1、图像处理作业一程序:%Createanimagelikethefollowing£º%NAME:Hw1_sol.m%DESC:SolutionofHw2programmingassignement%AUTHOR:%DATE:3-20-2011%initablackimage(Icreatedabiggerimageinordertohave%%enoughnestedsquaresspacefor)i=512;I=uint8(zeros(i));%initsidedecrementdelta_s=1;intensity=0;%initintensitywhileintensity256%updatetheimageindices=delta_s:i-delta_s;I(indices,indices)=intensity;intensity;imshow(I)%showtheresultsdelta_s=delta_s+40;%noticethewaymatlabhandlesthestringsintensity=intensity+35;%updatetheintensityend;运行结果: