need urgent help

>> n=-5:5;
>> [x1,nx1]=ustep(-n,-2);
>> [x2,nx2]=ramp(n,3);
>> [x3,nx3]=impulse(n,0);
>> [x,nx]=sigadd(x1,nx1,x2,nx2,x3,nx3);
??? Error using ==> sigadd
Too many input arguments.

>> [x,nx]=sigadd(x1,nx1,x2,nx2);
??? In an assignment A(I) = B, the number of elements in B and
I must be the same.

Error in ==> sigadd at 5
y1((n>=n1(1))&(n<=n1(end)))=x1;
.
.
.
.
function [y,n]=sigadd(x1,n1,x2,n2)
n=min(n1(1),n2(1)):max(n1(end),n2(end));
y1=zeros(1,length(n));
y2=y1;
y1((n>=n1(1))&(n<=n1(end)))=x1;
y2((n>=n2(1))&(n<=n2(end)))=x2;
y=y1+y2;
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories