illogical plotting and results in delayed function
Show older comments
Here is the function im dealing with
clear;
syms x(t) X(w)
f1 = 2;
f2 = 3;
x(t) =cos(2*pi*f1*t)
subplot(2,1,1);
ezplot(x);
subplot(2,1,2);
ezplot(x(t-10));
And here are the results

how is this possible, even though there it is a delayed function?
7 Comments
Walter Roberson
on 10 Nov 2018
Name a real-valued t such that cos(4*pi*t) is different than cos(4*pi*(t-10)) ?
Trulien Elmer
on 10 Nov 2018
Walter Roberson
on 10 Nov 2018
In order for the plots to be different, there must be at least one specific t value for which x(t) has a different result than x(t-10) . What is at least one such t value? For example, do you expect x(1/3) to be different than x(1/3-10) ?
Trulien Elmer
on 10 Nov 2018
Walter Roberson
on 10 Nov 2018
You expect the plots to be different. What is a specific t value at which you expect the two plots to have a different value, and what value are you expecting there for the two different plots ?
Trulien Elmer
on 10 Nov 2018
Edited: Trulien Elmer
on 10 Nov 2018
Walter Roberson
on 10 Nov 2018
Edited: Walter Roberson
on 10 Nov 2018
Delaying 4*pi*t by an integer t results in exactly the same value. cos 4*pi*t is periodic with a period of 1/2 so delaying it by 10 has no effect on the value.
Now if you were to take x(t-10.3) for example... Well, you would not be able to tell the difference compared to x(t-0.3) but it would be different than x(t)
Answers (1)
madhan ravi
on 10 Nov 2018
f1 = 2;
f2 = 3;
t=linspace(0,1,1000)
x=cos(2.*pi.*f1.*t)
x1=cos(2.*pi.*f2.*(t-10))
subplot(2,1,1);
plot(t,x);
subplot(2,1,2);
plot(t,x1);
Categories
Find more on Subplots 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!