回 帖 发 新 帖 刷新版面

主题:求高手指点呀!!!

1、编写一个MATLAB函数文件实现以下方程,并有运行结果验证: 
     

2、使用Simulink建立二阶系统 的模型,设ωn=10Hz,其输入为
一个幅度为2V、频率为0.5Hz的正弦波,并叠加一个0.1V的噪声信号,观察:
(1)没有叠加噪声信号时,当0<ζ<1、ζ=0、ζ=1及ζ>1时系统的响应。
(2)叠加噪声信号时,当0<ζ<1、ζ=0、ζ=1及ζ>1时系统的响应,并比较结果。

3、用MATLAB的GUIDE设计:能够把输入的摄氏温度转化成华氏温度(tout=tin*9/5+32),也能把华氏温度转换成摄氏温度(tout=(tin-32)*5/9)。

4、 ,t的变化范围为0~15,用不同的线型和标记点画出a=0.2和a=0.8两种情况下的曲线;并用箭头线标识出各曲线a的取值和添加标题 ,按下图要求编写MATLAB脚本M文件。
 

[size=2][size=3]那位高手可以帮我做一下呀!!![[/size][/size]color=FF0000][/color]

回复列表 (共1个回复)

沙发

第三题:
function wendu()
clf reset
set(gcf,'unit','normalized','position',[0.3,0.2,0.5,0.5],'name','双向温度转换','numbertitle','off');
set(gcf,'defaultuicontrolfontname','隶书');
set(gcf,'defaultuicontrolfontsize',12);
set(gcf,'defaultuicontrolhorizontal','left');
set(gcf,'defaultuicontrolunit','normalized');
htext1=uicontrol(gcf,'style','text','position',[0.1,0.8,0.15,0.1],'string','输入值');
hedit1=uicontrol(gcf,'style','edit','position',[0.28,0.8,0.2,0.1]);
htext2=uicontrol(gcf,'style','text','position',[0.5,0.8,0.15,0.1],'string','转换值');
hedit2=uicontrol(gcf,'style','edit','position',[0.68,0.8,0.2,0.1]);
hradio1=uicontrol(gcf,'style','radio','string','华氏温度->摄氏温度','position',[0.58,0.6,0.3,0.1]);
set(hradio1,'value',get(hradio1,'max'));
hradio2=uicontrol(gcf,'style','radio','string','摄氏温度->华氏温度','position',[0.58,0.4,0.3,0.1],'callback','set(hradio2,''value'',get(hradio2,''max'')),set(hradio1,''value'',get(hradio1,''min''))');
set(hradio1,'callback','set(hradio1,''value'',get(hradio1,''max'')),set(hradio2,''value'',get(hradio2,''min''))');
hpush=uicontrol(gcf,'style','push','position',[0.78,0.25,0.1,0.1],'string','Apply','callback','chen');
set(gcf,'userdata',[hedit1,hedit2,hradio1,hradio2]);
function chen()
h=get(gcf,'userdata');
str=get(h(1),'string');
h1=get(h(3),'value');
h2=get(h(4),'value');
if ~isempty(str)
    if h1
     x=str2num(str);
     y=(x-32)*5/9;
     z=num2str(y);
     set(h(2),'string',z);
    end
    if h2
       x=str2num(str);
       y=x*9/5+32;
       z=num2str(y);
       set(h(2),'string',z);
    end
else 
    error('please input');
end

我来回复

您尚未登录,请登录后再回复。点此登录或注册