From: Ender <jr147@msstate.edu>
Path: news.mathworks.com!newsfeed-00.mathworks.com!webcrossing
Newsgroups: comp.soft-sys.matlab
Subject: Re: running other applications
Message-ID: <ef5c942.4@webcrossing.raydaftYaTP>
Date: Fri, 6 Jul 2007 09:53:17 -0400
References: <ef5c942.-1@webcrossing.raydaftYaTP> <ef5c942.0@webcrossing.raydaftYaTP> <ef5c942.1@webcrossing.raydaftYaTP> <ef5c942.2@webcrossing.raydaftYaTP> <f6lh2p$4ie$1@fred.mathworks.com>
Lines: 41
NNTP-Posting-Host: 128.158.209.36
MIME-Version: 1.0
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
Xref: news.mathworks.com comp.soft-sys.matlab:417576



Steven Lord wrote:
>
>
>
> "Jeremy Smith" <smit1729@umn.NOSPAM.edu> wrote in message
> news:ef5c942.2@webcrossing.raydaftYaTP...
>> It all depends on the program you must run. As far as I know
the
>> only way to have a program do what you want it to do from
Matlab
>> itself the program must be able to accept command line inputs.
I
>> suspect (and could be wrong) any other method, aside from the
> command
>> line, would involve Java. If, however, your program does accept
>> command lines you can use "eval" along with "!".
>>
>> FileName = 'C:\File Location\File_Name';
>> eval(['! "C:\Program Files\SomeProgram\executable.exe" "'
> FileName
>> '"])
>
> Don't use EVAL -- you don't need to in this case. Use SYSTEM, DOS,
> or UNIX
> instead of !.
>
>
> theprogram = '"C:\Program Files\SomeProgram\executable.exe"';
> thearguments = 'foo bar';
> system(sprintf('%s %s', theprogram thearguments))
>
>
> --
> Steve Lord
> slord@mathworks.com
>
>
> What is the 'foo bar' command? Is 'foo bar' the file that I want to
open?

-Ender-