Network programming assignment for University
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.
 
 
 
 

30 lines
637 B

  1. function [F, T] = ARQ_time(fileName)
  2. %Parse ARQ log file
  3. % F: Frequency vector
  4. % T: Time vector
  5. %
  6. % author:
  7. % Christos Choutouridis AEM:8997
  8. % cchoutou@ece.auth.gr
  9. data = fopen (fileName);
  10. A = textscan(data,'%s','Delimiter','\n');
  11. B = A{1,1};
  12. fclose(data);
  13. s = size (B);
  14. T_ = zeros(s(1)-1, 1);
  15. j =1;
  16. for i = 2:s(1)
  17. C = textscan(B{i,1},'%s','Delimiter',' ');
  18. D = C{1};
  19. if str2num(D{18}) ~= 0 % it Total != 0
  20. T_(j) = str2num(D{15}); % get server response time
  21. j = j+1;
  22. end
  23. end
  24. T = T_(1:j);
  25. F = histcounts(T, 1:max(T));
  26. end