need help in matlab: ship navigation
I am very very new to matlab. I have been assigned a project and I need to run or that simulation and coding in matlab. My project title is regarding a smart antenna system which the beam form by an antenna should be in certain direction.
The code that I have writte for the radiation pattern of antenna is as below:
function[]=radiationplot
M=1800;
k=2*pi;
theta=linspace(0,2*pi,M+1);
N=input('number of elements (2,3,4,....):');
beta=input('phase difference between elements (pi/2, pi/4 or 3/3*pi etc....):');
d=1/4;
Y=k.*d.*cos(theta)+beta;
E= cos(theta);
AF= sin((N.*Y)./2)./(N.*sin(Y./2));
Pat=abs(E.*AF);
AFdb=20*log10(Pat);
figure;
polar(theta, abs(E.*AF));
%figure;
%polar_dB(theta, abs(E.*AF));
figure;
plot(theta.*180./pi,abs(E.*AF));
xlabel('theta 0 to 2pi');
ylabel('Gain of the radiation pattern');
grid on;
figure;
plot(theta.*180./pi,AFdb);
axis([0 360 -60 0])
xlabel('theta 0 to 2pi');
ylabel('Gain of the radiation pattern in dB');
grid on;
warning off;
These coding should be no problem to get the radiation pattern. The problem is how to write a code for docking a ship into a harbour based on this radiation pattern? (for example the ship antenna will tracking the maximum beamforming by base station, this is a tip given by my lecturer).
I have been working on this for several weeks but still doesn't cum out with anything useful. I am hoping that someone who is rather experience in matlab could give me some advice or guidance on this, thank you very much!!:)
The code that I have writte for the radiation pattern of antenna is as below:
function[]=radiationplot
M=1800;
k=2*pi;
theta=linspace(0,2*pi,M+1);
N=input('number of elements (2,3,4,....):');
beta=input('phase difference between elements (pi/2, pi/4 or 3/3*pi etc....):');
d=1/4;
Y=k.*d.*cos(theta)+beta;
E= cos(theta);
AF= sin((N.*Y)./2)./(N.*sin(Y./2));
Pat=abs(E.*AF);
AFdb=20*log10(Pat);
figure;
polar(theta, abs(E.*AF));
%figure;
%polar_dB(theta, abs(E.*AF));
figure;
plot(theta.*180./pi,abs(E.*AF));
xlabel('theta 0 to 2pi');
ylabel('Gain of the radiation pattern');
grid on;
figure;
plot(theta.*180./pi,AFdb);
axis([0 360 -60 0])
xlabel('theta 0 to 2pi');
ylabel('Gain of the radiation pattern in dB');
grid on;
warning off;
These coding should be no problem to get the radiation pattern. The problem is how to write a code for docking a ship into a harbour based on this radiation pattern? (for example the ship antenna will tracking the maximum beamforming by base station, this is a tip given by my lecturer).
I have been working on this for several weeks but still doesn't cum out with anything useful. I am hoping that someone who is rather experience in matlab could give me some advice or guidance on this, thank you very much!!:)
0