lesgoodfella
Newbie level 2
![Newbie level 2](/styles/images/ranks/alevel2.gif)
I need help in testing whether or not a system in time-invariant, the problem is, i don't know how to enter the system into matlab.
this is the system:
y
= n*x
+x(n-1)
then i want to shift it by 10 and compare the output.
This is my program and i get errors:
n = 0:40; D = 10;a = 3.0;b = -2;
x = a*cos(2*pi*0.1*n) + b*cos(2*pi*0.4*n);
n1 = n-1;
x1 = a*cos(2*pi*0.1*n1) + b*cos(2*pi*0.4*n1);
xd = [zeros(1,D) x];
xd1 = [zeros(1,D) x1];
y = n.*x+x1;
yd = n.*xd+xd1;
d = y - yd(1+D:41+D);
is there an easier way to do this?
this is the system:
y
then i want to shift it by 10 and compare the output.
This is my program and i get errors:
n = 0:40; D = 10;a = 3.0;b = -2;
x = a*cos(2*pi*0.1*n) + b*cos(2*pi*0.4*n);
n1 = n-1;
x1 = a*cos(2*pi*0.1*n1) + b*cos(2*pi*0.4*n1);
xd = [zeros(1,D) x];
xd1 = [zeros(1,D) x1];
y = n.*x+x1;
yd = n.*xd+xd1;
d = y - yd(1+D:41+D);
is there an easier way to do this?