<\/script>')

"pdfLatex stops working" Hint when called from Matlab

I am trying to call pdflatex in matlab. Code below

clc;
% analysis
i = 10;
n = 'Ashwani Roy';
x = 1:0.5:100;
y = sin(x.^2);
plot(x,y);
saveas(gcf, 'output', 'png')
%% write to tex
fid = fopen('Report.tex','w');
fprintf(fid,'%s\n','\documentclass{article}');
fprintf(fid,'%s\n','\usepackage{graphicx}');
fprintf(fid,'%s\n','\begin{document}');
fprintf(fid,'%s\n',strcat(num2str(i),':',n));
fprintf(fid,'%s\n','Some other text blah blah ');
fprintf(fid,'%s\n','\includegraphics{output.png}');
fprintf(fid,'%s\n','\end{document}');
fclose(fid);
%% DOS Invoke 
[status,cmdout] =dos('"C:/Program Files (x86)/MiKTeX 2.9/...
                       miktex/bin/pdflatex.exe" -shell-escape ...
                      --src -interaction=nonstopmode Report.tex');

      

It works and generates a Report.pdf which has the data I wanted, but it throws a Windows error that says psdlatex.exe has stopped working. Close or debug the program.

I am wondering how to suppress this prompt or fix the root cause of this.

+3


source to share


1 answer


Found a fix. I just reinstalled the whole MikTex 2.9 and it fixed the problem. Not sure what causes the thread to die early, but may be incomplete.



+2


source







All Articles