필터 지우기
필터 지우기

Can not run system commands from matlab -MAC OSX

조회 수: 57 (최근 30일)
Hasan
Hasan 2013년 11월 21일
댓글: Cristiana Dinea 2023년 3월 8일
I am trying to run a image processing software called Flirt through matlab. When I try
system'flirt', I get a /bin/bash: flirt: command not found error.
If I try system('/usr/local/fsl/bin/flirt'); then it works fine. Typing just flirt in terminal also launches the program.
Is there a way of setting matlab to find this program in path and running it without giving its full address?
Thanks
Hasan

답변 (1개)

Matthias Fripp
Matthias Fripp 2017년 10월 8일
For some reason, Matlab on a Mac doesn't see the whole search path you normally get in a terminal. So you need to add the directory to the $PATH environment variable within Matlab. You can do that temporarily by running
setenv('PATH', [getenv('PATH') ':/usr/local/fsl/bin']);
You can make this permanent by adding the command to a startup.m file somewhere in your Matlab path (as shown by Matlab's "path" command).
  댓글 수: 10
Walter Roberson
Walter Roberson 2023년 2월 25일
What steps did you take to put imglob and fslmerge onto your shell PATH? And what is the path to each of those executables?
Cristiana  Dinea
Cristiana Dinea 2023년 3월 8일
>> setenv('PATH', [getenv('PATH') ':/Users/cdinea/fsl/bin']);
and on my Mac fsl and imglob are recognized
cdinea@cdinea-mlt bin % imglob
Usage: imglob [-extension/extensions] <list of names>
-extension for one image with full extension
-extensions for image list with full extensions

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

카테고리

Help CenterFile Exchange에서 Timing and presenting 2D and 3D stimuli에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by