Creating Planar array and computing value of each element using an equation and element coordinate location in millimeters
Show older comments
I am creating an array of 23 (x-direction) X 23 (y-direction) unit cells. Each cell location needs to be defiend by its coordinate location in millimeters. Then using this x,y coordinate value to each cell and an equation, the value of each cell is computed and plotted against 360 degree color map. My code does not produce the required picture. The discritization seems incorrect as my array is not to scale of the required array.
x_v = zeros(23,1);
y_v = zeros(23,1);
for i=1:23
x_v(i)=1e-3*(4.5 + 9*(i-1));
y_v(i)=1e-3*(4.5 + 9*(i-1));
end
% phase profile equation
fo=10e9;
lambda= 3e8/fo;
ko= 360/lambda;
theta_i=0;
phi_i=0;
theta_r=25;
phi_r=30;
M = zeros(23,23);
for j=1:23
for i=1:23
M(j,i) = mod(-ko*(x_v(j)*(sind(theta_i)*cosd(phi_i)+sind(theta_r)*cosd(phi_r)) ...
+y_v(i)*(sind(theta_i)*sind(phi_i)+sind(theta_r)*sind(phi_r))),360);
end
end
imagesc(M)
colormap(jet)
colorbar
My result is this,
What is actually required is this, 
Secondly, If I want to have different number of cells in x and y axis of array then how to ensure x cells are plotted on x axis of figure and y cells on y axis, in my case they get inverted i.e x cells are plotted on y-axis and vice versa?
Accepted Answer
More Answers (0)
Categories
Find more on Graphics Performance 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!