Borrar filtros
Borrar filtros

Exciting latex file using Matlab giving errors

1 visualización (últimos 30 días)
Diana Dawoud
Diana Dawoud el 9 de Jul. de 2022
Respondida: dpb el 9 de Jul. de 2022
I have the following code
setenv('PATH', [getenv('PATH') ':/Library/TeX/texbin/pdflatex']);
setenv('PATH', [getenv('PATH') ':/X/Y/Documents/L.tex']);
command = 'pdflatex /X/Y/Documents/L.tex';
[status,cmdout] = system(command)
and I'm getting the following error
status =
127
cmdout =
'zsh:1: command not found: pdflatex
I got the path of /Library/TeX/texbin/pdflatex from typing "which pdflatex" using the terminal.
Any idea why I'm getting this error

Respuestas (1)

dpb
dpb el 9 de Jul. de 2022
The system function uses a shell program and spawns a new process in which the command is executed; hence, the environment seen in the new shell is brand new and environment settings from the executing shell in which MATLAB is running are not inherited/seen in the new shell.
You can set environment variables by executing chained commands or using batch file that does the needed background work before launching the executable.
There's more info at system in the "More About" section.

Categorías

Más información sobre MATLAB Report Generator en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by