Matlab codes


s2time.m   computes the elapsed computer time and print out the time in the format of "day,hour,minute,second"
density1.m   Do density estimation for a univariate x with a Gaussian kernal. I used it generate density distribution of some univariate variable to be plotted in Excel.
testmfilename.m   The file illustrate the use of mfilename in MATLAB. I use the returned string to generate other strings of filename to store my output, and data files.
testeval.m   This file illustrate how to use EVAL to evaluate a series of commands stored in strings
cmpdeff.m  

This file illustrates the relative efficiency in two methods in storing the data matrix.
Conclusion: If we many observations and many variables, it may save tremendous amount of time by appending (writing) the additional row to a data file (thus keeping the size of matrix small) instead of appending the additional row to a matrix (enlarging the matrix over time) and save the BIG data matrtix in a final step.



Back to top
Return to Ka-fu Wong's Home
Comments and suggestions should be sent to: kafuwong@econ.hku.hk