Date: Apr 7, 2012 3:21 PM
Author: dpb
Subject: Re: input name of sub-program name in dos command
On 4/7/2012 3:42 AM, hesam wrote:
> hi
> I use a dos program that need to input a name to run. I have a problem
> in run that program in matlab and because I want to run this program
> many times, I don't want to enter name of data every time .
> program is like this:
>>> run program
>>> ask me the name of sub-program name
>>> I enter the name of sub-program name
>
> I use many pattern to do this work like:
> ! my program/my input name
> dos('my program,my input name')
>
> but in these case, program run in matlab but write Can't find name file
> ,my input name file while all file are in matlab directory
IIUC, the problem is likely that the shell under which the program is
running is not in the Matlab working directory where the files are
(apparently) located.
Either instead submit a batch file that changes the directory to the
proper one then executes the program or pass a fully qualified file
name. (Or, of course, fix the environment PATH variable in the OS so
the executable program can find the files but that's kinda' klunky).
For the qualified file name route, you might find
doc fullfile % and friends
of interest/use.
--