声振论坛

 找回密码
 我要加入

QQ登录

只需一步,快速开始

查看: 1193|回复: 0

高手 求教 MATLAB要怎样定义一个通过编辑框输入值控制坐标轴长度的轴啊

[复制链接]
发表于 2006-5-24 22:42 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?我要加入

x
<STRONG>楼主  </STRONG> <br>
<TABLE cellSpacing=0 cellPadding=0 width="90%" align=center border=0>

<TR>
<TD width="100%">用MATLAB做一个界面 通过编辑框输入不同的数据改变总轴长以及单位长度并且坐标轴被划分为不同大小的网格 以下程序怎么改啊 这个程序输入轴长和刻度后不能在图形上正确显现  帮帮忙啊<br>%jiemian.m<br>global ctsl;    %测区总长<br>global ctsw;    %测区总宽<br>global ctml;    %网格长度<br>global ctmw;    %网格宽度<br>global V0;      %初始速度<br>global Vmax;    %最大速度<br>global iterN;  %迭代次数<br>global ctu;     %修正量系数<br>global wmeshnum;%宽度上网格个数<br>global lmeshnum;%长度上网格个数<br>global ctmeshnum;%网格总个数<br>global ctraynum;%射线条数<br>global ctmeshv;%网格速度<br>global AnalogV;%模拟波速<br>global cv_v;   %波速离差<br>global cv_t;   %走时离差<br>global v_baddis;   %波速最坏情况距离<br>global t_baddis; %走时最坏情况距离<br>global ctbptv;%<br>global meshbugprobability;  %单元格为缺陷的概率<br>global ultrasonictime; % 声时文件<br>global vpop;<br>global h_axes;<br>global h_fig;<br>%--------------------------------------------------------------------------------------------------------------------------<br>%生成图形界面<br>clf reset<br>H=axes('unit','normalized','position',[0,0,1,1],'visible','off');<br>set(gcf,'currentaxes',H);<br>h_fig=get(H,'parent');<br>set(h_fig,'menubar',menubar);<br>set(h_fig,'unit','normalized','position',[0.01 0.2 0.9 0.7]);<br>h_axes=axes('parent',h_fig,'unit','normalized','position',[0.04,0.4,0.5,0.4],...<br>    'fontsize',8);<br>str='CT成象信息输入';<br>set(h_fig,'name',str,'numbertitle','off');<br>xlabel('F面');<br>ylabel('L面');<br>title('B面');<br>str='R面';<br>text(ctsl+1,ctsw/2,str,'fontsize',8);<br>%--------------------------------------------------------------------------------------------------------------------------<br>%创建数据输入编辑框<br>%创建数据输入编辑框<br>h_text1=uicontrol(h_fig,'style','text','unit','normalized','position',...<br>    [0.6,0.75,0.06,0.04],'horizontal','left','string','数据输入');<br>h_text2=uicontrol(h_fig,'style','text','unit','normalized','position',...<br>    [0.6,0.68,0.06,0.04],'horizontal','left','string','轴总长');<br>h_text3=uicontrol(h_fig,'style','text','unit','normalized','position',...<br>    [0.6,0.58,0.06,0.04],'horizontal','left','string','轴总宽');<br>h_text4=uicontrol(h_fig,'style','text','unit','normalized','position',...<br>    [0.6,0.48,0.06,0.04],'horizontal','left','string','单位长度');<br>h_text5=uicontrol(h_fig,'style','text','unit','normalized','position',...<br>    [0.6,0.38,0.06,0.04],'horizontal','left','string','单位宽度');<br><br>h_edit2=uicontrol(h_fig,'style','edit','unit','normalized','position',...<br>    [0.67,0.68,0.10,0.04],'horizontal','left',...<br>    'callback','ctsl=str2num(get(gcbo,''string''))');<br>h_edit3=uicontrol(h_fig,'style','edit','unit','normalized','position',...<br>    [0.67,0.58,0.10,0.04],'horizontal','left',...<br>    'callback','ctsw=str2num(get(gcbo,''string''))');<br>h_edit4=uicontrol(h_fig,'style','edit','unit','normalized','position',...<br>    [0.67,0.48,0.10,0.04],'horizontal','left',...<br>    'callback','ctml=str2num(get(gcbo,''string''))');<br>h_edit5=uicontrol(h_fig,'style','edit','unit','normalized','position',...<br>    [0.67,0.38,0.10,0.04],'horizontal','left',...<br>    'callback','ctmw=str2num(get(gcbo,''string''))');<br>-----------------------------------------------------------------------------------<br><br>%--------------------------------------------------------------------------------------------------------------------<br>%添加控制按钮<br>h_push1=uicontrol(h_fig,'style','push',...<br>    'unit','normalized','position',[0.78,0.20,0.07,0.05],...<br>    'string','确定','callback',['axis([0 ctsl 0 ctsw]);','grid on']);<br>h_push2=uicontrol(h_fig,'style','push',...<br>    'unit','normalized','position',[0.90,0.20,0.07,0.05],...<br>    'string','退出','callback','close');<br>--------------------------------------------------<br><br><br><br><br></TD></TR></TABLE>
[此贴子已经被作者于2006-5-26 14:36:54编辑过]

本帖被以下淘专辑推荐:

回复
分享到:

使用道具 举报

您需要登录后才可以回帖 登录 | 我要加入

本版积分规则

QQ|小黑屋|Archiver|手机版|联系我们|声振论坛

GMT+8, 2024-11-20 11:43 , Processed in 0.069787 second(s), 20 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表