필터 지우기
필터 지우기

MATLAB environment variables

조회 수: 17 (최근 30일)
Ralf
Ralf 2011년 2월 4일
Hello,
I have a few MATLAB scripts which include the usage of 'matlabfrag' and 'matlabfrag to pdf'. I used them without any problem on my old Ubuntu machine. Now I want to use use them on a MacOS X 10.6 machine and I have the following problem: it seems MATLAB can't find the 'pdflatex'? It is installed on my machine. I got the error message:
/bin/bash: pdflatex: command not found
If I open a terminal I can use 'pdflatex', but not from MATLAB.
I assume it is a problem of setting the environment variables properly. But I don't know how and after one day trying and googleing for answers I hope someone here knows how to do it.
Thank you already in advance, Ralf

채택된 답변

Ralf
Ralf 2011년 2월 8일
I have solved it now. For everyone who is interested: if you use MacTeX 2010, the lines you have to add to the startup.m are:
setenv([getenv('PATH') ':/usr/texbin']);
setenv([getenv('PATH') ':/usr/local/bin']);
Ralf
  댓글 수: 1
Walter Roberson
Walter Roberson 2011년 2월 8일
That could be combined in to one:
setenv('PATH', [getenv('PATH') ':/usr/texbin:/usr/local/bin'])

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

Walter Roberson
Walter Roberson 2011년 2월 4일
setenv([getenv('PATH') ':/directory/of/pdflatex/']);
This is code to execute inside Matlab before running the script. You could add it to your startup.m file for example.
There are other avenues for making more permanent changes to your OS-X path, such as modifying your ~/.bashrc or ~/.login
  댓글 수: 3
Walter Roberson
Walter Roberson 2011년 2월 5일
Sorry, should have been
setenv('PATH', [getenv('PATH') ':/directory/of/pdflatex/']);
Ralf
Ralf 2011년 2월 5일
Thanks Walter, now the script is running! But for some reasons the PDF is not created even the 'matlabfrag to pdf' tells me it did. Hmmmm

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Programming에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by