2021-07-03 10:19:27 +02:00
|
|
|
function plotPositionAndVelocitySampling(obj, NumberOfBins)
|
2021-06-29 15:44:28 +02:00
|
|
|
|
|
|
|
f_h = Helper.getFigureByTag('RejectionSampling');
|
|
|
|
set(groot,'CurrentFigure',f_h);
|
|
|
|
a_h = get(f_h, 'CurrentAxes');
|
|
|
|
if ~isempty(get(a_h, 'Children'))
|
|
|
|
clf(f_h);
|
|
|
|
end
|
|
|
|
f_h.Name = 'Sampling';
|
|
|
|
f_h.Units = 'pixels';
|
|
|
|
|
|
|
|
set(0,'units','pixels');
|
|
|
|
screensize = get(0,'ScreenSize');
|
|
|
|
f_h.Position = [[screensize(3)/7 screensize(4)/7] 1.357e+03 770];
|
|
|
|
|
2021-07-03 10:19:27 +02:00
|
|
|
initialPositions = obj.InitialPositions;
|
|
|
|
initialVelocities = obj.InitialVelocities;
|
2021-06-29 15:44:28 +02:00
|
|
|
|
|
|
|
subplot(3,2,1)
|
|
|
|
histogram(initialPositions(:, 1)*1e3,NumberOfBins, 'LineStyle', 'none', 'DisplayName','x-Component')
|
|
|
|
xlabel('Positions (mm)','FontSize', 14)
|
|
|
|
ylabel('Counts','FontSize', 14)
|
|
|
|
legend('FontSize', 14)
|
|
|
|
|
|
|
|
subplot(3,2,3)
|
|
|
|
histogram(initialPositions(:, 2)*1e3,NumberOfBins, 'LineStyle', 'none', 'DisplayName','y-Component')
|
|
|
|
xlabel('Positions (mm)','FontSize', 14)
|
|
|
|
ylabel('Counts','FontSize', 14)
|
|
|
|
legend('FontSize', 14)
|
|
|
|
|
|
|
|
subplot(3,2,5)
|
|
|
|
histogram(initialPositions(:, 3)*1e3,NumberOfBins, 'LineStyle', 'none', 'DisplayName','z-Component')
|
|
|
|
xlabel('Positions (mm)','FontSize', 14)
|
|
|
|
ylabel('Counts','FontSize', 14)
|
|
|
|
legend('FontSize', 14)
|
|
|
|
|
|
|
|
subplot(3,2,2)
|
|
|
|
histogram(initialVelocities(:, 1),NumberOfBins, 'LineStyle', 'none', 'DisplayName','x-Component')
|
|
|
|
xlabel('Velocities (m/s)','FontSize', 14)
|
|
|
|
ylabel('Counts','FontSize', 14)
|
|
|
|
legend('FontSize', 14)
|
|
|
|
|
|
|
|
subplot(3,2,4)
|
2021-07-11 06:03:59 +02:00
|
|
|
histogram(initialVelocities(:, 2),NumberOfBins, 'LineStyle', 'none', 'DisplayName','y-Component')
|
|
|
|
xlabel('Velocities (m/s)','FontSize', 14)
|
2021-06-29 15:44:28 +02:00
|
|
|
ylabel('Counts','FontSize', 14)
|
|
|
|
legend('FontSize', 14)
|
|
|
|
|
|
|
|
subplot(3,2,6)
|
2021-07-11 06:03:59 +02:00
|
|
|
histogram(initialVelocities(:, 3),NumberOfBins, 'LineStyle', 'none', 'DisplayName','z-Component')
|
|
|
|
xlabel('Velocities (m/s)','FontSize', 14)
|
2021-06-29 15:44:28 +02:00
|
|
|
ylabel('Counts','FontSize', 14)
|
|
|
|
legend('FontSize', 14)
|
|
|
|
|
|
|
|
sgtitle('Rejection sampling for initial distributions','FontSize', 18)
|
2021-07-03 10:19:27 +02:00
|
|
|
|
|
|
|
Helper.bringFiguresWithTagInForeground();
|
2021-06-29 15:44:28 +02:00
|
|
|
end
|