I had some problems running this function. First of all, please change the name of the function in 'export2spss' instead of 'save4spss'. Secondly 'names' and 'vars' should be interchanged according to the help of this function.
After these changes the function works perfectly. Note: I had to close Matlab before SPSS was able to import the data.
4
27 Apr 2012
export data to spss / pasw
An example of how to successfully export data including variable names to spss.
Thanks! This is a great idea and works like a treat.
To run on a mac (or under linux) the slashes in file paths have to be changed accordingly. If they are replaced by the wildcard 'filesep' it automatically uses the appropriate ones and the function can be used under unix and windows. (The .sps isn't opened automatically under unix but that's just one click)