How to implement the math equation correctly to make a plot ?
1 view (last 30 days)
Show older comments
Vahram Voskerchyan
on 22 Jun 2021
Answered: Walter Roberson
on 22 Jun 2021
I have a equation for irradiance distribution that says.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/661005/image.jpeg)
it's an radiance distribution where the k is the wave vector , Λ is the period between the emitting elements. Implementing the equaiton can give the plot showing below. I am struggling to implement this equation when I plug everything in all I get is a single value. How do I loop this equation and create a matrix so it can give me the plot that is shown below ?
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/661010/image.jpeg)
%rectangular aperture array factor.
I_0 = 1;
lambda =1.55e-6;
k=(2*pi)/lambda;
period = 2e-6;
theta = 20;
numel=33;
I = I_0*abs(((sind(k*period*sind(theta))/k*period*sind(theta))*(sind(numel/2*k*sind(theta))/sind(0.5*k*period*sind(theta)))))
For now I am trying to implement the equation to have the plot like below. But this will only give a signle value. How can I implement the right equation to have the plot shown above.
2 Comments
Accepted Answer
Walter Roberson
on 22 Jun 2021
%rectangular aperture array factor.
N = 150;
I_0 = 1;
lambda =1.55e-6;
k=(2*pi)/lambda;
period = 2e-6;
theta = linspace(-25,25,N);
numel=33;
I = I_0 .* abs(((sind(k .* period .* sind(theta)) ./ k .* period .* sind(theta)) .* (sind(numel ./ 2 .* k .* sind(theta)) ./ sind(0.5 .* k .* period .* sind(theta)))));
plot(theta, I)
As you increase N, you will get a denser and denser plot that is more and more unreadable. That is because you are plotting a high frequency signal.
0 Comments
More Answers (0)
See Also
Categories
Find more on Surface and Mesh Plots 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!