clear all;
prompt = {'Height Antennas:','Height Tags:','Step:','Distance:','Frequency (MHz):'};
dlg_title = 'Input values';
num_lines = 1;
def = {'0','1','0.1','2','867'};
answer = inputdlg(prompt,dlg_title,num_lines,def);
h1=str2double(answer(1));
h2=str2double(answer(2));
st=str2double(answer(3));
d=str2double(answer(4));
f=str2double(answer(5));
v=0.72/st;
n= ceil(v);
y(1)= h2-0.36;
R1(1) = sqrt(d^2+(y(1)-h1)^2);
R2(1) = sqrt(d^2+(y(1)+h1)^2);
x(1)=R2(1)-R1(1);
for k=2:n,
y(k)=y(k-1)+st;
R1(k) = sqrt(d^2+(y(k)-h1)^2);
R2(k) = sqrt(d^2+(y(k)+h1)^2);
x(k)=R2(k)-R1(k);
end
c=3e8;
f=f*1e6;
lambda=c/f;
plot(x,y,'-rd')
for m=1:5,
lamb(m)=m*lambda;
str = sprintf ('l%d',m);
str = line([lamb(m) lamb(m)], [0 y(k)]);
lam = sprintf ('%d\\Lambda',m);
text(lamb(m),0, lam );
end
lamb2=lambda/2;
l12 = line([lamb2 lamb2], [0 y(k)]);
lam2 = sprintf ('\\Lambda/2');
text(lamb2,0, lam2 );
lamb32=3*(lambda/2);
l32= line([lamb32 lamb32], [0 y(k)]);
lam32 = sprintf ('3\\Lambda/2');
text(lamb32,0, lam32 );
lamb52=5*(lambda/2);
l52 = line([lamb52 lamb52], [0 y(k)]);
lam52 = sprintf ('5\\Lambda/2');
text(lamb52,0, lam52 );
lamb72=7*(lambda/2);
l72 = line([lamb72 lamb72], [0 y(k)]);
lam72 = sprintf ('7\\Lambda/2');
text(lamb72,0, lam72 );
lamb92=9*(lambda/2);
l92 = line([lamb92 lamb92], [0 y(k)]);
lam92 = sprintf ('9\\Lambda/2');
text(lamb92,0, lam92 );
lamb34=3*(lambda/4);
l34 = line([lamb34 lamb34], [0 y(k)]);
lam34 = sprintf ('3\\Lambda/4');
text(lamb34,0, lam34 );
lamb54=5*(lambda/4);
l54 = line([lamb54 lamb54], [0 y(k)]);
lam54 = sprintf ('5\\Lambda/4');
text(lamb54,0, lam54 );
lamb74=7*(lambda/4);
l74 = line([lamb74 lamb74], [0 y(k)]);
lam74 = sprintf ('7\\Lambda/4');
text(lamb74,0, lam74 );
lamb94=9*(lambda/4);
l94 = line([lamb94 lamb94], [0 y(k)]);
lam94 = sprintf ('9\\Lambda/4');
text(lamb94,0, lam94 );
lamb114=11*(lambda/4);
l114 = line([lamb114 lamb114], [0 y(k)]);
lam114 = sprintf ('11\\Lambda/4');
text(lamb114,0, lam114 );
lamb134=13*(lambda/4);
l134 = line([lamb134 lamb134], [0 y(k)]);
lam134 = sprintf ('13\\Lambda/4');
text(lamb134,0, lam134 );
ylabel('Height (m)', 'FontSize',10)
xlabel('Lambda (m)', 'FontSize',10)
grid on