bingjining 发表于 2006-5-24 22:42

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

<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',,'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',);<br>h_axes=axes('parent',h_fig,'unit','normalized','position',,...<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>    ,'horizontal','left','string','数据输入');<br>h_text2=uicontrol(h_fig,'style','text','unit','normalized','position',...<br>    ,'horizontal','left','string','轴总长');<br>h_text3=uicontrol(h_fig,'style','text','unit','normalized','position',...<br>    ,'horizontal','left','string','轴总宽');<br>h_text4=uicontrol(h_fig,'style','text','unit','normalized','position',...<br>    ,'horizontal','left','string','单位长度');<br>h_text5=uicontrol(h_fig,'style','text','unit','normalized','position',...<br>    ,'horizontal','left','string','单位宽度');<br><br>h_edit2=uicontrol(h_fig,'style','edit','unit','normalized','position',...<br>    ,'horizontal','left',...<br>    'callback','ctsl=str2num(get(gcbo,''string''))');<br>h_edit3=uicontrol(h_fig,'style','edit','unit','normalized','position',...<br>    ,'horizontal','left',...<br>    'callback','ctsw=str2num(get(gcbo,''string''))');<br>h_edit4=uicontrol(h_fig,'style','edit','unit','normalized','position',...<br>    ,'horizontal','left',...<br>    'callback','ctml=str2num(get(gcbo,''string''))');<br>h_edit5=uicontrol(h_fig,'style','edit','unit','normalized','position',...<br>    ,'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',,...<br>    'string','确定','callback',['axis();','grid on']);<br>h_push2=uicontrol(h_fig,'style','push',...<br>    'unit','normalized','position',,...<br>    'string','退出','callback','close');<br>--------------------------------------------------<br><br><br><br><br></TD></TR></TABLE>
[此贴子已经被作者于2006-5-26 14:36:54编辑过]
页: [1]
查看完整版本: 高手 求教 MATLAB要怎样定义一个通过编辑框输入值控制坐标轴长度的轴啊