Home

  » 
Winter 2006

   » Economics 202B

   » Economics 203B

   » Economics 207

   » Economics 211B

   » 
Mathematics 245B


 



MATLAB Tips

Ryan (February 3rd, 2006)

Check out the "textread" function in MATLAB.  We can read in the CPS file and name the variables in just one line i.e.

(I need to read the help file but it's something like this, where "%d" means "decimal")

[lnwage male ext...]=textread['cps85.txt','%d %d ext... %d']

Masa (February 2nd, 2006)

Here are tips on (1) output files and (2) t-test.

(1)
To create a output file, you might want to write your code in the
following way:

clear clc
delete ***.out
diary ***.out

(your code)

diary off

Then you can find a output file called ***.out in your folder.

(2)
MATLAB has some functions for special probability distributions.
For t-test, you might find commands tcdf and/or tinv helpful. For
details, type help tcdf
in your command window.

As you can easily guess,
tpdf, fcdf, finv, fpdf, chi2cdf, normcdf, etc
might also be useful for later problem sets.






This site is not © Copyright Michael Powell 2005-2025, No Rights Reserved
Steve's free web templates