How to use a command for the terminal which isn't a standard one?

조회 수: 47 (최근 30일)
Giosuè Basso
Giosuè Basso 2022년 12월 16일
답변: MJFcoNaN 2022년 12월 18일
I have to use this line of code which is supposed to generate the image of a graph using GraphViz (which is installed correctly as using the same line on the terminal works):
system('dot -Tpng graph.gv -o Graph.png');
/bin/bash: dot: command not found
but i get the error:
zsh:1: command not found: dot
Is there a way to make it work without using the GraphVIz add on?

채택된 답변

MJFcoNaN
MJFcoNaN 2022년 12월 18일
Hello,
'system' starts a new shell process which may not inherit your familiar environment.
I suggest you check the PATH in matlab by
getenv('PATH')
and then try to add some needed paths by setenv, such as
setenv("PATH", [getenv("PATH") ":" "where_is_the_dot_command"]);

추가 답변 (0개)

카테고리

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

제품


릴리스

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by