QQ登录

只需要一步,快速开始

 注册地址  找回密码
查看: 738|回复: 0
打印 上一主题 下一主题

【奠基经典】MATLAB实用程序案例之可设置函数曲线图视角的用户界面

[复制链接]
字体大小: 正常 放大

398

主题

13

听众

1340

积分

  • TA的每日心情
    慵懒
    2015-12-12 14:33
  • 签到天数: 81 天

    [LV.6]常住居民II

    跳转到指定楼层
    1#
    发表于 2015-7-31 00:05 |只看该作者 |倒序浏览
    |招呼Ta 关注Ta







    可设置函数曲线图视角的用户界面
    实例

    h0=figure('toolbar','none',...
    'position',[198 56 408 468],...
    'name','实例52');
    h1=axes('parent',h0,...
    'position',[0.15 0.5 0.7 0.5],...
    'visible','off');
    [x,y]=meshgrid(-8:0.5:8);
    r=sqrt(x.^2+y.^2)+eps;
    z=sin(r)./r;
    fh=surf(x,y,z);
    shading interp
    view([-60 30])
    fv=get(h1,'view');
    fv2=fv;
    camlight left
    sh1=uicontrol('parent',h0,...
    'style','slider',...
    'max',1,...
    'min',-1,...
    'value',fv(1)/180,...
    'position',[20 150 200 20],...
    'callback',[...
    'fv(1)=90*get(sh1,''value'');,',...
    'set(h1,''view'',[fv(1) fv(2)]),',...
    'set(ed1,''string'',fv(1))']);
    text1=uicontrol('parent',h0,...
    'style','text',...
    'string','方位角的变化滑标',...
    'position',[20 170 200 20]);
    sh2=uicontrol('parent',h0,...
    'style','slider',...
    'max',1,...
    'min',-1,...
    'value',fv(2)/180,...
    'position',[20 90 200 20],...
    'callback',[...
    'fv(2)=90*get(sh2,''value'');,',...
    'set(h1,''view'',[fv(1) fv(2)]),',...
    'set(ed2,''string'',fv(2))']);
    text2=uicontrol('parent',h0,...
    'style','text',...
    'string','仰角的变化滑标',...
    'position',[20 110 200 20]);
    ed1=uicontrol('parent',h0,...
    'style','edit',...
    'string',fv(1),...
    'position',[30 30 50 20]);
    text3=uicontrol('parent',h0,...
    'style','text',...
    'string','方位角的数值',...
    'position',[20 50 80 20]);
    ed2=uicontrol('parent',h0,...
    'style','edit',...
    'string',fv(2),...
    'position',[150 30 50 20]);
    text4=uicontrol('parent',h0,...
    'style','text',...
    'string','仰角的数值',...
    'position',[135 50 80 20]);
    pf1=uicontrol('parent',h0,...
    'style','pushbutton',...
    'string','重置',...
    'position',[280 120 50 30],...
    'callback',[...
    'set(h1,''view'',fv2),',...
    'set(sh1,''value'',fv2(1)/180),',...
    'set(sh2,''value'',fv2(2)/180),',...
    'set(ed1,''string'',fv2(1)),',...
    'set(ed2,''string'',fv2(2))']);
    pf2=uicontrol('parent',h0,...
    'style','pushbutton',...
    'string','关闭',...
    'position',[280 60 50 30],...
    'callback','close');








    关于本帖内容欢迎大家踊跃讨论,与在下交流!




    zan
    转播转播0 分享淘帖0 分享分享0 收藏收藏0 支持支持0 反对反对0 微信微信
    您需要登录后才可以回帖 登录 | 注册地址

    qq
    收缩
    • 电话咨询

    • 04714969085
    fastpost

    关于我们| 联系我们| 诚征英才| 对外合作| 产品服务| QQ

    手机版|Archiver| |繁體中文 手机客户端  

    蒙公网安备 15010502000194号

    Powered by Discuz! X2.5   © 2001-2013 数学建模网-数学中国 ( 蒙ICP备14002410号-3 蒙BBS备-0002号 )     论坛法律顾问:王兆丰

    GMT+8, 2025-6-24 03:15 , Processed in 0.517414 second(s), 52 queries .

    回顶部