1个回答
2013-12-27
展开全部
任意的信号卷积:
function y=juanji(f1,f2)
syms x t;
F1=laplace(f1,x,t);
F2=laplace(f2,x,t);
h3=F1*F2;
h4=simplify(h3);
y=ilaplace(h4,t,x);
```````````````````````````````````````````
function plotbutton1_Callback(hObject, eventdata, handles)
%-------------其他------------%
val=get(handles.listbox1,'value');
str=get(handles.listbox1,'string');
vala=get(handles.a,'string');
c=str2num(vala);
valb=get(handles.b,'string');
d=str2num(valb);
%%*************************************************************************
switch str{val}
case'出输f1(t)和f2(t)';
%---------绘制f1(t)---------%
val1=get(handles.f1,'string');
x=sym(val1);
axes(handles.axes1);
ezplot(x);
%---------绘制f2(t)---------%
val2=get(handles.f2,'string');
x=sym(val2);
axes(handles.axes2);
ezplot(x);
case 'f1(t)*f1(t)'
val3=get(handles.f1,'string');
f1=sym(val3);
y=juanji(f1,f1);
axes(handles.axes3);
ezplot(y);
case 'f2(t)*f2(t)'
val4=get(handles.f2,'string');
f2=sym(val4);
y=juanji(f2,f2);
axes(handles.axes4);
ezplot(y);
case 'f1(at)*f2(bt)'
if(c==1&&d==1)
val5=get(handles.f1,'string');
f1=sym(val5);
val6=get(handles.f2,'string');
f2=sym(val6);
y=juanji(f1,f2);
axes(handles.axes5);
ezplot(y);
elseif(c~=1||d~=1)
c=num2str(c);
d=num2str(d);
val7=get(handles.f1,'string');
f1=sym(val7);
val8=get(handles.f2,'string');
f2=sym(val8);
y=addm(f1,f2,c,d);
axes(handles.axes6);
ezplot(y);
end
end
function y=addm(f1,f2,c,d) //传递了两个参数来改变a,b的值
syms x t;
F1=laplace(f1,x,t/c);
F1=F1/abs(c);
y1=simplify(F1);
F2=laplace(f2,x,t/d);
F2=F2/abs(d);
y2=simplify(F2);
h3=y1*y2;
y=ilaplace(h3,t,x);
y=simplify(y);
function y=juanji(f1,f2)
syms x t;
F1=laplace(f1,x,t);
F2=laplace(f2,x,t);
h3=F1*F2;
h4=simplify(h3);
y=ilaplace(h4,t,x);
```````````````````````````````````````````
function plotbutton1_Callback(hObject, eventdata, handles)
%-------------其他------------%
val=get(handles.listbox1,'value');
str=get(handles.listbox1,'string');
vala=get(handles.a,'string');
c=str2num(vala);
valb=get(handles.b,'string');
d=str2num(valb);
%%*************************************************************************
switch str{val}
case'出输f1(t)和f2(t)';
%---------绘制f1(t)---------%
val1=get(handles.f1,'string');
x=sym(val1);
axes(handles.axes1);
ezplot(x);
%---------绘制f2(t)---------%
val2=get(handles.f2,'string');
x=sym(val2);
axes(handles.axes2);
ezplot(x);
case 'f1(t)*f1(t)'
val3=get(handles.f1,'string');
f1=sym(val3);
y=juanji(f1,f1);
axes(handles.axes3);
ezplot(y);
case 'f2(t)*f2(t)'
val4=get(handles.f2,'string');
f2=sym(val4);
y=juanji(f2,f2);
axes(handles.axes4);
ezplot(y);
case 'f1(at)*f2(bt)'
if(c==1&&d==1)
val5=get(handles.f1,'string');
f1=sym(val5);
val6=get(handles.f2,'string');
f2=sym(val6);
y=juanji(f1,f2);
axes(handles.axes5);
ezplot(y);
elseif(c~=1||d~=1)
c=num2str(c);
d=num2str(d);
val7=get(handles.f1,'string');
f1=sym(val7);
val8=get(handles.f2,'string');
f2=sym(val8);
y=addm(f1,f2,c,d);
axes(handles.axes6);
ezplot(y);
end
end
function y=addm(f1,f2,c,d) //传递了两个参数来改变a,b的值
syms x t;
F1=laplace(f1,x,t/c);
F1=F1/abs(c);
y1=simplify(F1);
F2=laplace(f2,x,t/d);
F2=F2/abs(d);
y2=simplify(F2);
h3=y1*y2;
y=ilaplace(h3,t,x);
y=simplify(y);
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询