plotting complex exponential function

3 views (last 30 days)
yann mushid mushid
yann mushid mushid on 19 Jan 2023
Commented: Walter Roberson on 20 Jan 2023
f=(0:10000);
d=(0.0075:0.03);
w=2*pi*f;
t=(0:0.2);
k=(81.6*pi);
rin=0.71;
%x=rin*exp(-1i*2*k*d);
y=0.71*exp(-1i*2*k*d);
d=abs(y);
plot(real(d),imag(y));
xlabel("thickness",'fontsize',10);
ylabel("rin",'FontSize', 10);
title("Input reflection coefficient as a function of the physical thickness 𝜆 ⁄ 8≤ 𝑑 ≤ 𝜆⁄2 ","fontsize",6);
grid on;
here is my code but when i try to run it it work but i dont gate any sygnal on de graphe the graph are just empty
i dont understant it please some one can help me or explain at the place i dit a wrong code

Answers (2)

Walter Roberson
Walter Roberson on 20 Jan 2023
d=(0.0075:0.03);
w=2*pi*f;
t=(0:0.2);
The default increment for the : operator is 1, so you are programming
d=(0.0075:1:0.03);
w=2*pi*f;
t=(0:1:0.2);
but 0.0075+1 > 0.03 so d will only have a single entry, and 0+1 > 0.2 so t will only have a single entry.

Walter Roberson
Walter Roberson on 20 Jan 2023
Removing the variables that you do not use, and setting a finer increment for d
d=(0.0075:0.001:0.03);
k=(81.6*pi);
y=0.71*exp(-1i*2*k*d);
plot(real(y),imag(y));
xlabel("thickness",'fontsize',10);
ylabel("rin",'FontSize', 10);
title("Input reflection coefficient as a function of the physical thickness 𝜆 ⁄ 8≤ 𝑑 ≤ 𝜆⁄2 ","fontsize",6);
grid on;
You were taking real(abs(y)) as your independent coordinate, but real(abs(y)) is constant
syms D
Y=0.71*exp(-1i*2*k*D);
abs(Y)
ans = 
but D is real so imag(D) is 0, so abs(Y) is the constant 71/100
  2 Comments
yann mushid mushid
yann mushid mushid on 20 Jan 2023
hook thank you
so if i plot this auther code is ti normal to gate a line or they are same mistake on my code?
f=(0:10);
t=(0:0.1);
w=2*pi*f;
rin=0.71;
%y=rin*exp(*-1i*w*t);
y=0.71*exp(-1i*w*t);
%rin=abs(y);
plot(real(f),imag(y));
Walter Roberson
Walter Roberson on 20 Jan 2023
t=(0:0.1);
That means you want to construct the list of numbers that starts with 0, and increases by 1 each time, and ends no later than 0.1 . That list describes only a single number.
Your f values are all integers and 2*pi*integer is a full sine or cosine cycle, so *exp(-1i*w*t) will have 0 imaginary part anywhere that t is an integer. But there is only 1 t value and it is an integer, so imag(y) is going to be 0 at that one location.

Sign in to comment.

Categories

Find more on Symbolic Math Toolbox 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!