Input:
So the next question is how you create a nice clean input file like the
one above
1) generate appropriate logs from your execution or simulation that captures appropriate information
2) use grep, sed, and gawk to clean the logs
3) use David's database functions to process the logs: sort, join, average,
min, max, group, and GroupBy
Of course you are asking "David, I know how to use grep, sed, and gawk,
but how can I use those incredible database functions on my log files?"
Here you go, add the following lines to you tcsh shell initialization file:
What is the difference between "group" and "groupby"?
group concatenates similar lines, groupby operates like the database operator
given the following datafile named data.dat
1000,1, 14611, 1000,10, 1883, 1000,100, 545,
executing the command
"group data.dat , 0"
produces
1000,1, 14611,10, 1883,100, 545,
"groupby data.dat , 0 sum 1"
produces
1000, 111
"groupby data.dat , 0 sum 1,2"
produces
1000, 111, 17039
groupby also supports the following operators: min, man, and avg
mycat operates like the standard cat command, except that it prepends the
filename to each line of the file
mysort allows sorting on numbers and strings in ascending or descending order
For more information, use the source. It is all there in CVS under
the Util module.
Notes:
1) fsdb stands for file system database
2) all commands take input from a named file and produces output on standard
out
3) If someone wants to make these commands more generally useful, they could
change them to take piped input and produce piped output with different options
for piping. Then you could introduce a simple language that would allow
you to string several commands together in order to process a file (gee,
this really is starting to sound like a database)
Output:
Matlab can output files to multiple formats. The most convenient
are eps and jpeg
For example, adding these two lines to a matlab script prints the current
figure in both jpg and eps
Note that color graphs display poorly on black and white papers, so for
conference submissions, I suggest that you only use the black and white
version of eps output from matlab