HW2: Add the rest of the report (w/o the prof)

This commit is contained in:
2025-01-13 00:19:46 +02:00
parent 6e301bce99
commit 3305a0ef71
44 changed files with 5385 additions and 91 deletions
Binary file not shown.

After

Width:  |  Height:  |  Size: 533 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 374 KiB

+46
View File
@@ -0,0 +1,46 @@
% Data from the table
Q = [20, 23, 25, 27];
p_values = [1, 2, 3, 4, 5, 6, 7];
measurements = [
40, 42, 62.87, 123.25, 158.81, 233.52, NaN; % Q=20
285, 331.7, 465.5, 956.7, 1364.5, 1755.5, NaN; % Q=23
1174, 1354.5, 1940.4, 3994.2, 5373.8, 7139.9, NaN; % Q=25
4761.5, 5952.5, 8154.7, 15910, 21440, 27800, NaN; % Q=27
];
% ToDo: Add the measurements
% Create the figure window
figure('Name', 'Results', 'Position', [100, 100, 1600, 720]);
% Plot 1: One plot for each Q
subplot(1, 2, 1);
hold on;
for i = 1:length(Q)
plot(1:length(p_values), measurements(i, :), '-o', 'DisplayName', sprintf('Q=%d', Q(i)));
end
hold off;
xlabel('p');
ylabel('Time (ms)');
title('Plot for each Q');
legend('Location', 'northwest');
grid on;
xticks(1:length(p_values));
xticklabels(1:length(p_values));
% Plot 2: One line for each p
subplot(1, 2, 2);
hold on;
for j = 1:length(p_values) - 1 % ToDo: Remove -1 for p=7
plot(Q, measurements(:, j), '-o', 'DisplayName', sprintf('p=%d', j));
end
hold off;
xlabel('Q');
ylabel('Time (ms)');
title('Plot for each p');
legend('Location', 'northwest');
grid on;
% Enhance appearance
% sgtitle('Measurement Results');
print(gcf, 'AllMeasurements', '-dpng', '-r600');
+25
View File
@@ -0,0 +1,25 @@
% Data for new measurements
p_values = [1, 2, 3, 4, 5, 6]; % ToDo: add 7th p and time
measurements = [
4761.5, 2957.5, 1940.4, 1985.2, 1364.5, 901.1
];
% Create the figure window
figure('Name', 'Results', 'Position', [100, 100, 1600, 900]);
% Plot: Time vs p
hold on;
plot(p_values, measurements, '-o', 'DisplayName', '2^{28} numbers');
hold off;
xlabel('p');
ylabel('Time (ms)');
title('Time for $2^{28}$ numbers', 'Interpreter', 'latex', 'FontSize', 16);
grid on;
legend('Location', 'northwest');
% Set x-axis to integer values
ticks = min(p_values):max(p_values);
xticks(ticks);
% Save the plot
print(gcf, 'FixSizeMeasurements', '-dpng', '-r600');