AUTH's THMMY "Parallel and distributed systems" course assignments.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

plotsA.m 1.2 KiB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. % Data from the table
  2. Q = [20, 23, 25, 27];
  3. p_values = [1, 2, 3, 4, 5, 6, 7];
  4. measurements = [
  5. 40, 42, 62.87, 123.25, 158.81, 233.52, NaN; % Q=20
  6. 285, 331.7, 465.5, 956.7, 1364.5, 1755.5, NaN; % Q=23
  7. 1174, 1354.5, 1940.4, 3994.2, 5373.8, 7139.9, NaN; % Q=25
  8. 4761.5, 5952.5, 8154.7, 15910, 21440, 27800, NaN; % Q=27
  9. ];
  10. % ToDo: Add the measurements
  11. % Create the figure window
  12. figure('Name', 'Results', 'Position', [100, 100, 1600, 720]);
  13. % Plot 1: One plot for each Q
  14. subplot(1, 2, 1);
  15. hold on;
  16. for i = 1:length(Q)
  17. plot(1:length(p_values), measurements(i, :), '-o', 'DisplayName', sprintf('Q=%d', Q(i)));
  18. end
  19. hold off;
  20. xlabel('p');
  21. ylabel('Time (ms)');
  22. title('Plot for each Q');
  23. legend('Location', 'northwest');
  24. grid on;
  25. xticks(1:length(p_values));
  26. xticklabels(1:length(p_values));
  27. % Plot 2: One line for each p
  28. subplot(1, 2, 2);
  29. hold on;
  30. for j = 1:length(p_values) - 1 % ToDo: Remove -1 for p=7
  31. plot(Q, measurements(:, j), '-o', 'DisplayName', sprintf('p=%d', j));
  32. end
  33. hold off;
  34. xlabel('Q');
  35. ylabel('Time (ms)');
  36. title('Plot for each p');
  37. legend('Location', 'northwest');
  38. grid on;
  39. % Enhance appearance
  40. % sgtitle('Measurement Results');
  41. print(gcf, 'AllMeasurements', '-dpng', '-r600');