Drexel dragonThe Math ForumDonate to the Math Forum

Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: Help with UNIX() command
Replies: 5   Last Post: Apr 5, 2013 10:43 PM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Nasser Abbasi

Posts: 6,253
Registered: 2/7/05
Re: Help with UNIX() command
Posted: Apr 4, 2013 4:32 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

On 4/4/2013 2:52 PM, John wrote:

>> But may be this helps
>> http://www.mathworks.com/help/matlab/ref/system.html
>> "system
>> Execute operating system command and return output"

> [s,w]=unix('to3d -session e126 -prefx 4244_run_01 -epan -time:zt 28 104 1800 altplus ./s1037/*MRDC*')
> /bin/bash: to3d: command not found
> That is what I run and the error I get. Using system produces the same error.
>The problem is MATLAB is trying to run it through a bash shell, and its a
>command for a c-shell(csh). I need to know how to get MATLAB to execute
>the command in a c-shell. and ! will not work either for the exact same reason.

Matlab is not trying to do anything. Matlab knows nothing about c-shells
or bash or sh or DOS or anything of this stuff.

I am sure all what it does is an exec() somewhere and hands the new process created the
command you issued to run.

"The initial argument for these functions is the name of a file that is to be executed"

So you need to look at your own login process to see what default shell
gets invoked for it. Basically, if you can login to Linux and
type the above command from the terminal and it works, then you should be able to
do the same from Matlab using the system("command")

It looks like your linux login sets bash as the default shell, and the
PATH is not setup to find c-shell, or c-shell it not installed.

You have to look at the command itself first, make sure it works OK on
its own.


Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© The Math Forum at NCTM 1994-2016. All Rights Reserved.