Skip to content
Snippets Groups Projects
Commit 1601741a authored by lmaresz's avatar lmaresz
Browse files

Plot fix pt2

parent f8b3d35c
Branches
No related tags found
No related merge requests found
......@@ -29,13 +29,23 @@ classdef BalazsAperture < Aperture
histogram = obj.getCollisionHistogram();
figure;
x = linspace(-obj.size/2, obj.size/2, length(histogram));
subplot(2,1,1);
plot(x, abs(histogram));
subplot(2,1,2);
plot(x, angle(histogram));
title("Apertúrán áthaladó sugarak eloszlása");
xlabel("Pozíció");
stem(x, abs(histogram),'MarkerSize',0.001);
title("Apertúrán áthaladó sugarak száma");
xlabel("r'");
ylabel("Sugarak száma");
xlim([-obj.size/2, obj.size/2]);
subplot(2,1,2);
stem(x, angle(histogram),'MarkerSize',0.001);
title("Apertúra megvilágításfüggvénye - fázis");
xlabel("r'");
xlim([-obj.size/2, obj.size/2]);
ylim([-pi, pi]);
yticks([-pi, -3*pi/4, -pi/2, -pi/4, 0, pi/4, pi/2, 3*pi/4, pi]);
yticklabels({'-\pi', '', '-^{1}/_{2}\pi', '',...
'0', '', '^{1}/_{2}\pi', '', '\pi'});
end
end
end
......@@ -35,19 +35,29 @@ classdef SegmentedAperture < Aperture
function plotApertureField(obj)
figure;
[histogram,x1, x2] = obj.getCollisionHistogram();
plot(0, 0);
hold on;
% for k = 1:length(histogram)
% plot([x1(k) x2(k)], [abs(histogram(k)), abs(histogram(k))],'b');
% end
x = [x1; x2];
h = [histogram; histogram];
subplot(2,1,1);
plot(x(:), abs(h(:)));
plot(x(:), abs(h(:)), 'LineWidth', 1.5);
title("Apertúra megvilágítsáfüggvénye - amplitúdó");
xlabel("r'");
ylabel("|E(r')|");
xlim([-obj.size/2, obj.size/2]);
subplot(2,1,2);
plot(x(:), angle(h(:)));
%plot(x(:), h(:), 'b');
hold off;
plot(x(:), angle(h(:)), 'LineWidth', 1.5);
title("Apertúra megvilágítsáfüggvénye - fázis");
xlabel("r'");
ylabel("argE(r') [rad]");
xlim([-obj.size/2, obj.size/2]);
ylim([-pi, pi]);
yticks([-pi, -3*pi/4, -pi/2, -pi/4, 0, pi/4, pi/2, 3*pi/4, pi]);
yticklabels({'-\pi', '', '-^{1}/_{2}\pi', '',...
'0', '', '^{1}/_{2}\pi', '', '\pi'});
end
end
end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment