How to check if two equations are equal
Show older comments
Hello, I'm trying to verify if an equation is time-invariant or not time-invariant. So I'm putting two equations in a for loop to see if the values of each equation are equal. In theory, these values should be equal, but it is outputting, not time-invariant. Any help?
clear
syms t
x1(t)=cos(t);
y1(t)=1-2*x1(t-1);
x2(t)=cos(t-3);
y2(t)=1-2*x2(t-1);
for t=-pi():.1:pi()
Check_Y=y1(t-3);
Check_X=y2(t);
if Check_X~=Check_Y
disp('Not time invarient')
break
end
if t==-pi()+6.2
disp('Time invarient')
end
end
t=-pi():.1:pi();
figure
subplot(3,1,1)
plot(t,y1(t))
title('x(t):y(t)')
subplot(3,1,2)
plot(t,y2(t))
title('x(t-3):y(t)')
subplot(3,1,3)
plot(t,y1(t-3))
title('y(t-3)')
Accepted Answer
More Answers (0)
Categories
Find more on Mathematics in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!