10 | | The user could import MySQL database to Microsoft Excel and use chart and other tools to analyze the measurements. |
11 | | |
12 | | Matlab is another tool can be used. Sample Matlab code is shown below |
13 | | {{{ |
14 | | function nsf(dbServer, dbUser, dbPW, database); |
15 | | % Part where we retrieve data from the database; |
16 | | mysql('open',dbServer, dbUser, dbPW); |
17 | | mysql('use', database); |
18 | | output = struct('time',[],'thr_all',[],'node',[]); |
19 | | [output.time, output.thr_all, output.node] = mysql('select timestamp, throughput, node_id from group2'); |
20 | | [thru1_4, time1_4, thru3_1, time3_1] = sort_mysql(output); |
21 | | % Finally, the plotting part |
22 | | subplot(2,1,1); |
23 | | plot(time1_4, thru1_4, '-*'); |
24 | | title('Throughput On Obstructed Link'); |
25 | | xlabel('Time (sec)'); ylabel('Throuhput (bps)'); grid on; |
26 | | subplot(2,1,2); |
27 | | plot(time3_1, thru3_1, '-*'); |
28 | | title('Throughput On Monitor Node'); xlabel('Time (sec)'); |
29 | | ylabel('Throuhput (bps)'); grid on; |
30 | | }}} |
31 | | |
32 | | And the resulting graph is show below: |
33 | | |
34 | | [[Image(Matlabexample.PNG)]] |
35 | | |
| 9 | == Using Perl scripts == |
| 60 | == Using Microsoft Excel == |
| 61 | |
| 62 | Microsoft Excel can be used to analyze an experiment as shown below. |
| 63 | |
| 64 | [[Image(Excelexample.PNG)]] |
| 65 | |
| 66 | The user could import MySQL database to Microsoft Excel and use chart and other tools to analyze the measurements. |
| 67 | |
| 68 | ==Using Matlab == |
| 69 | |
| 70 | Matlab is another tool can be used. Sample Matlab code is shown below |
| 71 | {{{ |
| 72 | function nsf(dbServer, dbUser, dbPW, database); |
| 73 | % Part where we retrieve data from the database; |
| 74 | mysql('open',dbServer, dbUser, dbPW); |
| 75 | mysql('use', database); |
| 76 | output = struct('time',[],'thr_all',[],'node',[]); |
| 77 | [output.time, output.thr_all, output.node] = mysql('select timestamp, throughput, node_id from group2'); |
| 78 | [thru1_4, time1_4, thru3_1, time3_1] = sort_mysql(output); |
| 79 | % Finally, the plotting part |
| 80 | subplot(2,1,1); |
| 81 | plot(time1_4, thru1_4, '-*'); |
| 82 | title('Throughput On Obstructed Link'); |
| 83 | xlabel('Time (sec)'); ylabel('Throuhput (bps)'); grid on; |
| 84 | subplot(2,1,2); |
| 85 | plot(time3_1, thru3_1, '-*'); |
| 86 | title('Throughput On Monitor Node'); xlabel('Time (sec)'); |
| 87 | ylabel('Throuhput (bps)'); grid on; |
| 88 | }}} |
| 89 | |
| 90 | And the resulting graph is show below: |
| 91 | |
| 92 | [[Image(Matlabexample.PNG)]] |