MATLAB: How to save data structures? (Currently get nonsense files)

data structuressave

Hi everyone,
I'm trying to save data structures (from a rather complex calculation set) so I can later call up that data and manipulate it.
To simplify, I attempt
%Create some data
S.a = 1
S.b = 2
%Save Data
save('MyData.m','S')
Which runs successfully, but the saved file is nonsense that matlab cannot handle:
MATLAB 5.0 MAT-file, Platform: MACI64, Created on: Fri Jul 25 14:51:40 2014 IM#xãc``0b6 æÒ À
å3Â1#C"f³èÉ$xãc``0b6 æÒ À
å3Â1#CfÒL@øË
Have not found any solutions on google and trying other file formats (eg. .dat) hasn't made a difference
Any ideas what is going on or how to fix would be gratefully received!
Thanks.
Edit: running R2012b
Edit: Should also clarify that the output fails to work with the "load" command either
load('Test_struct_save.m')
Error using load
Number of columns on line 2 of ASCII file
[stuff]Project/matlab_code/Test_struct_save.m
must be the same as previous lines.

Best Answer

Save it as a .mat file instead of a .m file.
save('MyData.mat','S')