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

1 view (last 30 days)
  • 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 !

Accepted Answer

Walter Roberson
Walter Roberson on 12 Dec 2012
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.

More Answers (0)

Categories

Find more on Printing and Saving in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!