5.18.2010

Data transfer from Matlab to Stata and reverse

Zip file with Matlab code to export or import datasets to Stata. For use in conjunction with "insheet/outsheet". Importing data from Stata is restricted to numeric variables (but not the reverse).


(also includes scripts for dropping missing obs in matlab)

enjoy!

http://dl.dropbox.com/u/3011470/stata_translation.zip

-------------------------------------

matlab to stata

in matlab:

cell2csv(cellarrayname, 'dataname')

then in stata:

insheet using dataname.csv

-------------------------------------

stata to matlab

in stata:

outsheet varlist using dataname, comma

then in matlab:

data = csv2mat_numeric('dataname.out')

1 comment: