欢迎来到三一办公! | 帮助中心 三一办公31ppt.com(应用文档模板下载平台)
三一办公
全部分类
  • 办公文档>
  • PPT模板>
  • 建筑/施工/环境>
  • 毕业设计>
  • 工程图纸>
  • 教育教学>
  • 素材源码>
  • 生活休闲>
  • 临时分类>
  • ImageVerifierCode 换一换
    首页 三一办公 > 资源分类 > DOCX文档下载  

    magnify matlab源程序.docx

    • 资源ID:3161139       资源大小:37.43KB        全文页数:7页
    • 资源格式: DOCX        下载积分:6.99金币
    快捷下载 游客一键下载
    会员登录下载
    三方登录下载: 微信开放平台登录 QQ登录  
    下载资源需要6.99金币
    邮箱/手机:
    温馨提示:
    用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)
    支付方式: 支付宝    微信支付   
    验证码:   换一换

    加入VIP免费专享
     
    账号:
    密码:
    验证码:   换一换
      忘记密码?
        
    友情提示
    2、PDF文件下载后,可能会被浏览器默认打开,此种情况可以点击浏览器菜单,保存网页到桌面,就可以正常下载了。
    3、本站不支持迅雷下载,请使用电脑自带的IE浏览器,或者360浏览器、谷歌浏览器下载即可。
    4、本站资源下载后的文档和图纸-无水印,预览文档经过压缩,下载后原文更清晰。
    5、试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。

    magnify matlab源程序.docx

    magnify matlab源程序% start of program function magnify(f1)% magnify(f1)% Figure creates a magnification box when under the mouse position when a button is pressed. Press '+'/'-' while% button pressed to increase/decrease magnification. Press '&gt'/'&lt' while button pressed to increase/decrease box size.% Hold 'Ctrl' while clicking to leave magnification on figure.% Example:% plot(1:100,randn(1,100),(1:300)/3,rand(1,300), grid on,% magnify;if (nargin = 0), f1 = gcf; end;figure(f1); set(f1, .'WindowButtonDownFcn', ButtonDownCallback, .'WindowButtonUpFcn', ButtonUpCallback, .'WindowButtonMotionFcn', ButtonMotionCallback, .'KeyPressFcn', KeyPressCallback);return;function ButtonDownCallback(src,eventdata)f1 = src;a1 = get(f1,'CurrentAxes');a2 = copyobj(a1,f1);set(f1, .'UserData',f1,a1,a2, .'Pointer','fullcrosshair', .'CurrentAxes',a2);set(a2, .'UserData',2,0.2, . %magnification, frame size'Color',get(a1,'Color'), .'Box','on');xlabel(''); ylabel(''); zlabel(''); title(''); set(get(a2,'Children'), .'LineWidth', 2);set(a1, .'Color',get(a1,'Color')*0.95);set(f1, .'CurrentAxes',a1);ButtonMotionCallback(src);return;function ButtonUpCallback(src,eventdata)H = get(src,'UserData');f1 = H(1); a1 = H(2); a2 = H(3);set(a1, .'Color',get(a2,'Color');set(f1, .'UserData', .'Pointer','arrow', .'CurrentAxes',a1);if strcmp(get(f1,'SelectionType'),'alt'),delete(a2);end;return;function ButtonMotionCallback(src,eventdata)H = get(src,'UserData');if isempty(H)f1 = H(1); a1 = H(2); a2 = H(3);a2_param = get(a2,'UserData');f_pos = get(f1,'Position');a1_pos = get(a1,'Position');f_cp, a1_cp = pointer2d(f1,a1);set(a2,'Position',(f_cp./f_pos(3:4) 0 0+a2_param(2)*a1_pos(3)*-1 -1 2 2);a2_pos = get(a2,'Position');set(a2,'XLim',a1_cp(1)+(1/a2_param(1)*(a2_pos(3)/a1_pos(3)*diff(get(a1,'XLim')*-0.5 0.5);set(a2,'YLim',a1_cp(2)+(1/a2_param(1)*(a2_pos(4)/a1_pos(4)*diff(get(a1,'YLim')*-0.5 0.5);end;return;function KeyPressCallback(src,eventdata)H = get(gcf,'UserData');if isempty(H)f1 = H(1); a1 = H(2); a2 = H(3);a2_param = get(a2,'UserData');if (strcmp(get(f1,'CurrentCharacter'),'+') | strcmp(get(f1,'CurrentCharacter'),'=')a2_param(1) = a2_param(1)*1.2;elseif (strcmp(get(f1,'CurrentCharacter'),'-') | strcmp(get(f1,'CurrentCharacter'),'_')a2_param(1) = a2_param(1)/1.2;elseif (strcmp(get(f1,'CurrentCharacter'),'&lt') | strcmp(get(f1,'CurrentCharacter'),',')a2_param(2) = a2_param(2)/1.2;elseif (strcmp(get(f1,'CurrentCharacter'),'&gt') | strcmp(get(f1,'CurrentCharacter'),'.')a2_param(2) = a2_param(2)*1.2;end;set(a2,'UserData',a2_param);ButtonMotionCallback(src);end;return;% Included for completeness (usually in own file)function fig_pointer_pos, axes_pointer_val = pointer2d(fig_hndl,axes_hndl)%pointer2d(fig_hndl,axes_hndl)%Returns the coordinates of the pointer (in pixels)%in the desired figure (fig_hndl) and the coordinates% in the desired axis (axes coordinates)% Example:% figure(1),% hold on,% for i = 1:1000,% figp,axp=pointer2d;% plot(axp(1),axp(2),'.','EraseMode','none');% drawnow;% end;% hold off% Rick Hindman - 4/18/01if (nargin = 0), fig_hndl = gcf; axes_hndl = gca; end;if (nargin = 1), axes_hndl = get(fig_hndl,'CurrentAxes'); end;set(fig_hndl,'Units','pixels');pointer_pos = get(0,'PointerLocation');%pixels 0,0 lower leftfig_pos = get(fig_hndl,'Position');%pixels l,b,w,hfig_pointer_pos = pointer_pos - fig_pos(1,2);set(fig_hndl,'CurrentPoint',fig_pointer_pos);if (isempty(axes_hndl),axes_pointer_val = ;elseif (nargout = 2),axes_pointer_line = get(axes_hndl,'CurrentPoint');axes_pointer_val = sum(axes_pointer_line)/2;end;% end of program

    注意事项

    本文(magnify matlab源程序.docx)为本站会员(牧羊曲112)主动上传,三一办公仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知三一办公(点击联系客服),我们立即给予删除!

    温馨提示:如果因为网速或其他原因下载失败请重新下载,重复下载不扣分。




    备案号:宁ICP备20000045号-2

    经营许可证:宁B2-20210002

    宁公网安备 64010402000987号

    三一办公
    收起
    展开