save4spss

saves numerical matrices as ASCII data + SPSS import syntax
1.7K Downloads
Updated 10 Oct 2005

No License

save4spss()opens dialogue boxes to select a matrix,a cell array with variable names (optional),and specify a file name to save the matrix the SPSS syntax gets the same name.

save4spss(DATA,VARNAMES,FILE) saves the matrix DATA in the file given in FILE and creates a SPSS syntax file FILE.sps to import these data in SPSS .Variables (data columns) are named according to the elements of cell array VARNAMES.
After running save4spss, just open the generated SPSS syntax in SPSS and run it. Also see help save4spss

example:
mystudy=[1 30 10000; 2 35 15000];
varnames={'subject';'age';'income'}
save4spss(mystudy,varnames,'mystudy.dat')
creates an ASCII file mystudy.dat and a SPSS syntax mystudy.sps.

If you run this syntax in SPSS the data are imported, the variables named and the file is saved as mystudy.sav

Cite As

Robert Schleicher (2024). save4spss (https://www.mathworks.com/matlabcentral/fileexchange/8659-save4spss), MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R14SP1
Compatible with any release
Platform Compatibility
Windows macOS Linux
Categories
Find more on Workspace Variables and MAT-Files in Help Center and MATLAB Answers

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Version Published Release Notes
1.0.0.0

summary sentence incomplete