1、命令行键入:fig = figure;%给出图形窗口。
2、命令行键入:t = text(.05,.1,'你好&拭貉强跳#39;,'FontSize',20,'FontWeight','b泠贾高框old');%使用 text 函数在坐标区中绘制文本。
3、命令行键入:F = getframe(gca,[10 10 200 200]);%使用 getframe 命令从屏幕上捕获文本并关闭图窗。
4、命令行键入:close(fig)%关闭fig。
5、命令行键入:c = F.cdata(:,:,1);[i,j] = find(c==0);
6、命令行键入:load mandrillind = sub2i艘绒庳焰nd(size(X),i,j);X(ind) = uint8(255);%找到黑色像素(黑色是 0)并使用 sub2ind 将它们的下标转换为索引。
7、命令行键入:imagesc(X)colormap bone%使用 bone 颜色图显示新图像。