声振论坛

 找回密码
 我要加入

QQ登录

只需一步,快速开始

查看: 839|回复: 2

请高手看看错在哪

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

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

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

x
<P>clf reset<BR>H=axes( 'unit' , 'normalized' , 'position' ,[0,0,1,1], 'visible' , 'off' );<BR>set(gcf, 'currentaxes' ,H);<BR>str= '\fontname{ 隶书 } 如图 ' ;<BR>text(0.12,0.93,str, 'fontsize' ,13);<BR>h_fig=get(H, 'parent' );<BR>set(h_fig, 'unit' , 'normalized' , 'position' ,[0.1,0.2,0.7,0.4]);<BR>h_axes=axes( 'parent' ,h_fig, ...<BR>'unit' , 'normalized' , 'position' ,[0.1,0.15,0.55,0.7], ...<BR>'xlim' ,[0 15], 'ylim' ,[0 1.8], 'fontsize' ,8); </P>

<P>h_text1=uicontrol(h_fig, 'style' , 'text' , ...<BR>'unit' , 'normalized' , 'position' ,[0.8,0.8,0.1,0.10], ...<BR>'horizontal' , 'left' , 'string' ,{ ' 输入t1 ' , 't1 ='});<BR>h_edit1=uicontrol(h_fig, 'style' , 'edit' , ...<BR>'unit' , 'normalized' , 'position' ,[0.8,0.7,0.1,0.10], ...<BR>'horizontal' , 'left' , ...<BR>'callback' ,[ ...<BR>'z=str2num(get(gcbo,''string''));' , ...<BR>'t=0:0.1:15;' , ...<BR>'for k=1:length(z);' , ...<BR>'s2=tf(1,[1 2*z(k) 1]); ' , ...<BR>'y(:,k)=step(s2,t);' , ...<BR>'plot(t,y(:,k));' , ...<BR>'if (length(z)&gt;1) ,hold on,end,' , ...<BR>'end;' , ...<BR>'hold off,' ]); </P>
<P>h_text2=uicontrol(h_fig, 'style' , 'text' , ...<BR>'unit' , 'normalized' , 'position' ,[0.8,0.6,0.1,0.10], ...<BR>'horizontal' , 'left' , 'string' ,{ ' 输入t2 ' , 't2 ='});<BR>h_edit2=uicontrol(h_fig, 'style' , 'edit' , ...<BR>'unit' , 'normalized' , 'position' ,[0.8,0.50,0.1,0.10], ...<BR>'horizontal' , 'left' , ...<BR>'callback' ,[ ...<BR>'z=str2num(get(gcbo,''string''));' , ...<BR>'t=0:0.1:15;' , ...<BR>'for k=1:length(z);' , ...<BR>'s2=tf(1,[1 2*z(k) 1]); ' , ...<BR>'y(:,k)=step(s2,t);' , ...<BR>'plot(t,y(:,k));' , ...<BR>'if (length(z)&gt;1) ,hold on,end,' , ...<BR>'end;' , ...<BR>'hold off,' ]); </P>
<P>h_text3=uicontrol(h_fig, 'style' , 'text' , ...<BR>'unit' , 'normalized' , 'position' ,[0.8,0.4,0.1,0.10], ...<BR>'horizontal' , 'left' , 'string' ,{ ' 输入t3 ' , 't3 ='});<BR>h_edit3=uicontrol(h_fig, 'style' , 'edit' , ...<BR>'unit' , 'normalized' , 'position' ,[0.8,0.3,0.1,0.10], ...<BR>'horizontal' , 'left' , ...<BR>'callback' ,[ ...<BR>'z=str2num(get(gcbo,''string''));' , ...<BR>'t=0:0.1:15;' , ...<BR>'for k=1:length(z);' , ...<BR>'s2=tf(1,[1 2*z(k) 1]); ' , ...<BR>'y(:,k)=step(s2,t);' , ...<BR>'plot(t,y(:,k));' , ...<BR>'if (length(z)&gt;1) ,hold on,end,' , ...<BR>'end;' , ...<BR>'hold off,' ]); </P>
<P><BR>h_text4=uicontrol(h_fig, 'style' , 'text' , ...<BR>'unit' , 'normalized' , 'position' ,[0.8,0.2,0.1,0.10], ...<BR>'horizontal' , 'left' , 'string' ,{ ' 输入t4 ' , 't4 ='});<BR>h_edit4=uicontrol(h_fig, 'style' , 'edit' , ...<BR>'unit' , 'normalized' , 'position' ,[0.8,0.1,0.1,0.10], ...<BR>'horizontal' , 'left' , ...<BR>'callback' ,[ ...<BR>'z=str2num(get(gcbo,''string''));' , ...<BR>'t=0:0.1:15;' , ...<BR>'for k=1:length(z);' , ...<BR>'s2=tf(1,[1 2*z(k) 1]); ' , ...<BR>'y(:,k)=step(s2,t);' , ...<BR>'plot(t,y(:,k));' , ...<BR>'if (length(z)&gt;1) ,hold on,end,' , ...<BR>'end;' , ...<BR>'hold off,' ]); </P>

<P>h_push1=uicontrol(h_fig, 'style' , 'push' , ...<BR>'unit' , 'normalized' , 'position' ,[0.67,0.37,0.12,0.15], ...<BR>'string' , 'grid on' , 'callback' , 'grid on' );<BR>h_push2=uicontrol(h_fig, 'style' , 'push' , ...<BR>'unit' , 'normalized' , 'position' ,[0.67,0.15,0.12,0.15], ...<BR>'string' , 'grid off' , 'callback' , 'grid off' ); <BR></P>
回复
分享到:

使用道具 举报

发表于 2006-5-23 11:18 | 显示全部楼层
<P>你想做什么?我运行这个程序是对的,没显示有错误!~</P>
 楼主| 发表于 2006-5-23 11:30 | 显示全部楼层
对应输入t1-t4,运行grid on 得到图形,grid off清除.
您需要登录后才可以回帖 登录 | 我要加入

本版积分规则

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

GMT+8, 2024-9-25 17:24 , Processed in 0.053549 second(s), 18 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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