Write a matlab script to add two discreate signal.
MATLAB SCRIPT
function [2,N]=ADDING (x,a,x2,b)
n1=[3 4 2 1 3]
n2=[1 5 3 6 4 7]
a=[-1:3];
b=[-2:3];
n11=min(a);
n12=max(a):
subplot (2,2,1);
stam (a,x);
title ('sequence1');
n12=min(b);
n22=max(b):
subplot (2,2,2);
stam (b,n2);
title ('sequence1');
k=abs(n11)-abs(n21);
b=abs(k);
if(k>0)
x2= [zeros(1,p),n2];
else
x1= [zeros(1,p),x];
end;
s=abs(n12)-abs(n22);
r=abs(s);
if(s>0):
n2=[(n2,zeros(1,r)];
else
n1=[(n1,zeros(1,r)];
end
z=n1+n2;
if[abs(n11) > abs(n21)]
n1=n11;
else
n1=n21;
end
if [abs (n12)> abs(n22)]
n2=n21;
else
n2=n22;
subplot (2,2,3);
stem (n,2);
title ('resultant sequence');
result: they we have done the addition of two discreate signals'
discussions:
1. proper looking of commands should be own
2.put commons & sem collumns at right place
3.no . of divison should be to the graph.
No comments:
Post a Comment