1- format longG
2-
3- data = readtable(' /Users/mymac/Documents/SCRIPTSHEET/SKRIPSI/data_jmeter/4/LatenciesOverTime.csv' , ' ReadVariableNames' , false , ' HeaderLines' , 1 );
4-
5- % ini untuk format date seperti halnya di jmeter ya
6- % x = seconds((datenum(datestr(data.ElapsedTime, 'yyyy-mm-dd hh:MM:ss.fff')) - datenum(datestr(data{1,1}, 'yyyy-mm-dd hh:MM:ss.fff'))) * 100000);
7- % x.Format = 'hh:mm:ss';
8-
9- markers = {' +' ,' *' ,' .' ,' o' ,' x' ,' v' ,' d' ,' ^' ,' s' ,' >' ,' <' ,' v' ,' p' ,' h' ,' p' ,' v' ,' <' ,' >' ,' s' ,' ^' ,' d' ,' v' ,' x' ,' o' ,' .' ,' *' };
10- colors = {' r' ,' b' ,' m' ,' k' ,' y' ,' c' ,' g' ,' c' ,' y' ,' k' ,' m' ,' b' };
11- lines = {' -' ,' --' ,' :' ,' -.' ,' :' ,' --' };
12- line_width = 0.9 ;
13- marker_size = 5 ;
14- marker_counter = 1 ;
15- color_counter = 1 ;
16- line_counter = 1 ;
17- ylabels= ' Response Time (ms)' ;
18- ylabels1= ' Number of Threads' ;
19- ylabels2= ' Mega Bytes (MB)' ;
20- ylabels3= ' TCP Connections' ;
21- legend_base_name = ' data-' ;
22-
23- % kalo ini format number dalam menit elapsed time
24- % x = (datenum(datestr(data{:,1}, 'yyyy-mm-dd hh:MM:ss.fff')) - datenum(datestr(data{1,1}, 'yyyy-mm-dd hh:MM:ss.fff'))) * 100000/60;
25-
26- % ini untuk data x yang pure number aja, bukan elapsed time
27- x = data{: ,2 };
28-
29- hold on
30- title(' Any Plot' );
31- xlabel(' Elapsed time (minutes), Granulation: 500 ms' ,' FontSize' ,12 ,' FontWeight' ,' bold' );
32- ylabel(ylabels3 ,' FontSize' ,12 ,' FontWeight' ,' bold' );
33- disp(data )
34- pmfs= zeros(size(x(: )));
35- for i= 1 : length(x )
36- pmfs(i )= sum(px(find(sx == x(i ))));
1+ function [vals , freqs ] = pmf(X )
2+ % #PMF Return the probability mass function for a vector/matrix.
3+ % #
4+ % #INPUTS:
5+ % # X Input matrix
6+ % #
7+ % #OUTPUTS:
8+ % # VALS Vector of unique values
9+ % # FREQS Vector of frequencies of occurence of each value.
10+ % #
11+
12+ [vals ,junk ,idx ] = unique(X );
13+
14+ vals = vals(: );
15+ frequs = NaN(length(vals ),1 );
16+
17+ for i = 1 : length(vals )
18+ freqs(i ) = mean(idx == i );
3719 end
38- % pmfs = histcounts(data{:,2},[unique(data{:,2}) Inf],'Normalization','probability');
39- histogram(pmfs );
40-
4120
21+ % # If 0 or 1 output is requested, put the values and counts in two columns
22+ % # of a matrix.
23+ if nargout < 2
24+ vals = [vals freqs ];
25+ end
4226
43- box on ;
44- ax = gca ;
45- ax.YAxis.Exponent = 0 ;
46- legend(' show' );
47- hold off
27+ end
0 commit comments