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

Plot fix pt2

parent f8b3d35c
No related branches found
No related tags found
No related merge requests found
...@@ -29,13 +29,23 @@ classdef BalazsAperture < Aperture ...@@ -29,13 +29,23 @@ classdef BalazsAperture < Aperture
histogram = obj.getCollisionHistogram(); histogram = obj.getCollisionHistogram();
figure; figure;
x = linspace(-obj.size/2, obj.size/2, length(histogram)); x = linspace(-obj.size/2, obj.size/2, length(histogram));
subplot(2,1,1); subplot(2,1,1);
plot(x, abs(histogram)); stem(x, abs(histogram),'MarkerSize',0.001);
subplot(2,1,2); title("Apertúrán áthaladó sugarak száma");
plot(x, angle(histogram)); xlabel("r'");
title("Apertúrán áthaladó sugarak eloszlása");
xlabel("Pozíció");
ylabel("Sugarak száma"); 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 end
end end
...@@ -35,19 +35,29 @@ classdef SegmentedAperture < Aperture ...@@ -35,19 +35,29 @@ classdef SegmentedAperture < Aperture
function plotApertureField(obj) function plotApertureField(obj)
figure; figure;
[histogram,x1, x2] = obj.getCollisionHistogram(); [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]; x = [x1; x2];
h = [histogram; histogram]; h = [histogram; histogram];
subplot(2,1,1); 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); subplot(2,1,2);
plot(x(:), angle(h(:))); plot(x(:), angle(h(:)), 'LineWidth', 1.5);
%plot(x(:), h(:), 'b'); title("Apertúra megvilágítsáfüggvénye - fázis");
hold off; 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 end
end end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment