Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

To resolve issues starting MATLAB on Mac OS X 10.10 (Yosemite) visit: http://www.mathworks.com/matlabcentral/answers/159016

Automated Latex report of calculations: works in full Matlab, does not work in standalone ?

Asked by Steven on 12 Dec 2012
  • Context: I developed a calculation tool for image processing. The program runs through a GUI. I made the tool available for my colleagues in other divisions worldwide by deploying the script to a standalone .exe-file.
  • Goal: To be able to have an automated report print out of the results.
  • How: I create a .tex-file in the script for this, using code like
     fid = fopen('Report.tex','w');
     fprintf(fid,'%s\n','\documentclass{article}');
     fprintf(fid,'%s\n','\begin{document}');
     ...%%%code to include the graphs and numbers saved in the Matlab-scripts
     ...%%%in the .TeX-code   
     fprintf(fid,'%s\n','\end{document}');
     fclose(fid);
     dos(['pdflatex Report -job-name='])
  • Problem: This works perfectly when running the script in 'full' Matlab mode. IN STANDALONE MODE HOWEVER, the script does not manage to write the .TeX-script.
  • Question: Does anyone know how to solve this ? Is there any specific measure I must take/package to load/.... in order to be able to write a .tex-file in standalone mode ?

Many thanks for any help !

0 Comments

Steven

Products

No products are associated with this question.

1 Answer

Answer by Walter Roberson on 12 Dec 2012
Accepted answer

Are you sure that it does not produce the file, but in a directory that you do not expect? The current directory for standalone executables is not the directory that you launch the executable from. You would be safer to use uiputfile() to have the user select the directory and filename.

2 Comments

Steven on 12 Dec 2012

Good point, will check on that.

Thanks for the suggestion.

Steven on 13 Dec 2012

Worked out wel..many thanks Walter !!!

Walter Roberson

Contact us