matlabfrag
A matlab figure to .eps and .tex file exporter, similar to LaPrint
Author: Zebb Prime

08 Apr 2010

matlabfrag
A matlab figure to .eps and .tex file exporter, similar to LaPrint
Author: Zebb Prime

So I decided to post a small solution.
Changes lines 48-53 from

v = version;
v = sscanf(v,'%i.%i');
v = eval( sprintf('%i.%i',v(1),v(2)) );
if v(1) < 7
error('matlabfrag:oldMatlab','Matlabfrag requires Matlab r2007a or newer to run');
end

to

v = version;
v = sscanf(v,'%i.%i');
if (v(1) < 7) || ((v(1) == 7) && (v(2) < 4))
error('matlabfrag:oldMatlab','Matlabfrag requires Matlab r2007a or newer to run');
end

08 Apr 2010

matlabfrag
A matlab figure to .eps and .tex file exporter, similar to LaPrint
Author: Zebb Prime

It's a really great script. I used it to create the plots of my masters thesis. At the moment there is a small error with Matlab 7.10 . The script needs Matlab 7.3 or newer, but in the script 7.10 is recognized as 7.10<7.3 .

Good job! However, I may have found a bug related to cell code mode.
Consider this piece of code
s1 = 'hello\n';
s2 = 'h\n';
cprintf('red', s1)
cprintf('black', s2)
if you run it as a normal script (using F5) everything is fine. But if you run the same code in cell mode (using CTRL+Enter) the result is not what you expected.
This is driving me crazy. I use Matlab R2013b and I use lots of cell code in my scripts, so this is giving me some annoyance.
This is even more complicated since if you try to run the code in debug mode, the problem doesn't show up anymore!
I think the problem is related to the fact that, when using cell code mode, the name of the script file is not passed to the command window (while it appears in the cmd window when using F5) and this in some way reflects in the computation of the current position in the command window.

This is a really good submission, thanks!
I was able to add a predefined style 'Warnings' by
a. adding a 'Warnings' entry in the validStyles cell (after the 'Errors' entry) in function processStyleInfo,
b. changing the subsequent 'elseif mathces < 8' to 'elseif matches < 9' and
c. changing the following 'requestedColor = colors(matches-7,:);' to 'requestedColor = colors(matches-8,:);'.
It seems to be working fine so far.

An interesting exploration into the inner workings of MATLAB, beautifully explained by the author on his blog. I particularly like the innovative use of RGB values as the unique color strings, that allows any color to be displayed. (Great blog too!)