enlarge.m

来自「hi i have a huge collection are you int」· M 代码 · 共 37 行

M
37
字号
function enlarge%%function enlarge%%      ENLARGE Produces an enlarged plot of a section of the present%      plot chosen with the mouse.%      %                                     A. Knight%                                     disp('Place the mouse on one corner of the section you wish to')disp('enlarge and click the button.')[X(1),Y(1)] = ginput(1);holdstate = ishold;hold onxlims = get(gca,'xlim');ylims = get(gca,'Ylim');h1 = plot([X(1) X(1)],[ylims(1) ylims(2)],'g-');h2 = plot([xlims(1) xlims(2)],[Y(1) Y(1)],'g-');disp('Place the mouse on the other corner and click.')[X(2),Y(2)] = ginput(1);if X(1)==X(2) | Y(1)==Y(2),   error('Chosen window too narrow.')endif X(2)<X(1)   X = fliplr(X);endif Y(2)<Y(1)   Y = fliplr(Y);endaxis([X(1) X(2) Y(1) Y(2)])delete(h1)delete(h2)if ~holdstate  hold offend

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?