BcBob wrote:
I have developed another solution to inserting matlab code into Lyx using the
'highlight.m' function from the matlab file exchange. This function creates
latex output for the syntax colored matlab code. I wrote a driver function
matlb2tex.m that takes care of the details. You can insert the latex into an
ERT in your Lyx document.

Thank you for sharing it!

The matlab code and a sample Lyx document are in the attached zip file.

Bob

http://n2.nabble.com/file/n2865240/matlab2tex.zip matlab2tex.zip

However, I tried to test a simple matlab file, following the notes on the lyx file, and I got the following error:

??? Error using ==> fprintf
Invalid file identifier.  Use fopen to generate a valid file identifier.

Error in ==> highlight>write_highlighted_code at 126
   fprintf(outfid,out_format.pre_start);

Error in ==> highlight at 110
write_highlighted_code(mfid,outfid,opt)

Error in ==> matlab2tex at 57
highlight(mfile,opt,fid);


FYI matlab version is
>> version
ans =
7.4.0.336 (R2007a)

Best regards
Oscar

Reply via email to