Error using matlab2tikz on scatter plot with Matlab 2010b
Hi
I've created two vectors C (currents between -200 and +200) and M (magnetization between -1 and +1) from experimental data and then did the following:
scatter(C, M);
matlab2tikz('magnscatter.tikz');
Unfortunately, this gave me a strange error. The full output is below:
***
*** This is matlab2tikz v0.1.0.
*** The latest updates can be retrieved from
***
*** http://www.mathworks.com/matlabcentral/fileexchange/22022-matlab2tikz
***
*** where you can also make suggestions and rate matlab2tikz.
***
*** matlab2tikz uses features of Pgfplots which may be available only in recent version.
*** Make sure you have at least Pgfplots 1.3 available.
*** For best results, use \pgfplotsset{compat=newest}, and for speed use \pgfplotsset{plot coordinates/math parser=false} .
***
??? Index exceeds matrix dimensions.
Error in ==> matlab2tikz>drawScatterPlot at 2002
str = strcat( str, ...
Error in ==> matlab2tikz>drawHggroup at 1903
[m2t,str] = drawScatterPlot( m2t, h );
Error in ==> matlab2tikz>handleAllChildren at 390
[m2t, env] = drawHggroup( m2t, child );
Error in ==> matlab2tikz>drawAxes at 763
[ m2t, childrenEnvs ] = handleAllChildren( m2t, handle );
Error in ==> matlab2tikz>saveToFile at 300
[m2t,env] = drawAxes( m2t, visibleAxesHandles(ix(k)),
alignmentOptions(ix(k)) );
Error in ==> matlab2tikz at 231
saveToFile( m2t, fid, fileWasOpen );
I have no idea what could have gone wrong, so help would be greatly appreciated.
Thanks in advance,
Wouter

Solution
So I found the solution: plot the data in a line plot with a marker of choice specified and the line disabled. Then run matlab2tikz. Apparently the scatter plot as such is not 'compatible' with matlab2tikz. The documentation (README) doesn't really mention that (in fact it says scatter plots ARE handled well) so maybe that can be changed, just for good measure.