Thread Subject: Problem about running external program

Subject: Problem about running external program

From: Xiao LI

Date: 30 Jul, 2009 07:21:01

Message: 1 of 6

I want to use matlab to run an external program, and let the external program open a .dat file. When I use the command "!canny.exe my.dat", it just opened the canny program but does not run the my.dat file. What's wrong? Thanks.

Subject: Problem about running external program

From: Steven Lord

Date: 30 Jul, 2009 13:48:12

Message: 2 of 6


"Xiao LI" <clz1978@163.com> wrote in message
news:h4rhkt$ds2$1@fred.mathworks.com...
>I want to use matlab to run an external program, and let the external
>program open a .dat file. When I use the command "!canny.exe my.dat", it
>just opened the canny program but does not run the my.dat file. What's
>wrong? Thanks.

Is the canny.exe program written so that it expects its first input argument
to be the name of a data file? If not, then how would it know what to do
with that first input argument? If it does, then you will need to work with
the developer of the canny.exe program to debug why it's not behaving as
expected.

--
Steve Lord
slord@mathworks.com

Subject: Problem about running external program

From: Xiao LI

Date: 30 Jul, 2009 14:22:03

Message: 3 of 6

"Steven Lord" <slord@mathworks.com> wrote in message
> Is the canny.exe program written so that it expects its first input argument
> to be the name of a data file? If not, then how would it know what to do
> with that first input argument? If it does, then you will need to work with
> the developer of the canny.exe program to debug why it's not behaving as
> expected.
>
Thank you for your suggestion.
In the Canny.exe program, to do the analysis you need to open one file, e.g. my.dat, which tells the content of analysis. I just do not know how can I let matlab to tell the Canny.exe to open this dat file.

Subject: Problem about running external program

From: Xiao LI

Date: 31 Jul, 2009 06:20:19

Message: 4 of 6

There must be someone knowing how to solve this problem.

Subject: Problem about running external program

From: TideMan

Date: 31 Jul, 2009 10:50:11

Message: 5 of 6

On Jul 31, 6:20 pm, "Xiao LI" <clz1...@163.com> wrote:
> There must be someone knowing how to solve this problem.

What about:
system('canny.exe < my.dat')

Subject: Problem about running external program

From: dpb

Date: 31 Jul, 2009 13:02:52

Message: 6 of 6

Xiao LI wrote:
> "Steven Lord" <slord@mathworks.com> wrote in message
>> Is the canny.exe program written so that it expects its first input argument
>> to be the name of a data file? If not, then how would it know what to do
>> with that first input argument? If it does, then you will need to work with
>> the developer of the canny.exe program to debug why it's not behaving as
>> expected.
>>
> Thank you for your suggestion.
> In the Canny.exe program, to do the analysis you need to open one
> file, e.g. my.dat, which tells the content of analysis. I just do not
> know how can I let matlab to tell the Canny.exe to open this dat
> file.

You can try input redirection -- put the name of the input file to open
in another file and try

canny <input.fil

from the command prompt. If that works, translate it to they system()
function in ML. If it doesn't, you're basically forced to figuring out
if you can manage to stuff keystrokes directly to the app via whichever
OS API-set you happen to be working under. There's certainly no
guarantee you can get that to work, either...

--

Tags for this Thread

Everyone's Tags:

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Tag Activity for This Thread
Tag Applied By Date/Time
dat Xiao LI 30 Jul, 2009 03:24:05
open Xiao LI 30 Jul, 2009 03:24:05
external program Xiao LI 30 Jul, 2009 03:24:04
rssFeed for this Thread

Contact us at files@mathworks.com