Matlab's dos(Batch_Variable Arg1_Variable Arg2 Variable) is giving an "Error: Missing operator, comma, or semicolon"

Hi,

I am trying to run the following command in Matlab to get Windows Command Prompt to run an executable followed by 3 argument variables.

Running it as
dos(Batch_Variable Arg1_Variable Arg2_Variable, Arg3_Variable)
Gives me the error
"Error: Missing operator, comma, or semicolon"

Running it as
dos(Batch_Variable, Arg1_Variable, Arg2_Variable, Arg3_Variable)
Gives me the error
"Error using ==> dos"  "Too many input arguments"

What could be a solution?
VWrestle97Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

TextReportCommented:
I would guess you have a missing ,

dos(Batch_Variable Arg1_Variable, Arg2_Variable, Arg3_Variable)

or you shouldn't have commas

dos(Batch_Variable Arg1_Variable Arg2_Variable Arg3_Variable)

Cheers, Andrew

0
VWrestle97Author Commented:
Trying this
dos(Batch_Variable Arg1_Variable, Arg2_Variable, Arg3_Variable)
Gives me this error
"??? Error: File: <location of m file>: Line: <line#> Column: <column#>
")" expected, "identifier" found.

Error while evaluating uicontrol Callback"

and trying this
dos(Batch_Variable Arg1_Variable Arg2_Variable, Arg3_Variable)
Gives me the error
"Error: Missing operator, comma, or semicolon"
0
TextReportCommented:
Have you tried without the comma?

dos(Batch_Variable Arg1_Variable Arg2_Variable Arg3_Variable)

Cheers, Andrew
0
Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

VWrestle97Author Commented:
yes,

dos(Batch_Variable Arg1_Variable Arg2_Variable, Arg3_Variable)
Gives me the error
"Error: Missing operator, comma, or semicolon"

    * Accept and Award Points
    * Accept as Solution

0
VWrestle97Author Commented:
oops, I mean..

dos(Batch_Variable Arg1_Variable  Arg2_Variable Arg3_Variable)
Gives me this error
"??? Error: File: <location of m file>: Line: <line#> Column: <column#>
")" expected, "identifier" found.

Error while evaluating uicontrol Callback"
0
TextReportCommented:
dont know if this helps

http://www.isas.de/en/menu-top/research/research-departments/jcamp-dx-utilities/

"The Matlab funktion dos() has two parameters, the function call for the external program Dx2Asx.exe as well as the option echo. This option re-directs the output of the external program to the Matlab window. The return value of the external program is stored in the variable error. When Dx2Asc.exe terminates with no errors then the returned value is 0."

>> error = dos('Dx2Asc.exe jcampfile.dx textfile.csv ','-echo');

So it looks like the first parameter should be a single string that includes teh command line exactly as you would have it in the command window.

Cheers, Andrew
0
Steve KnightIT ConsultancyCommented:
I think you may need to do it like this:

dos([Batch_Variable Arg1_Variable  Arg2_Variable Arg3_Variable])

as it appears you need that to combine the three variables into one for the command.

Never used it myself I'm afraid, just what I've read.

Steve
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
jscroftCommented:
The dos command takes strings as arguments. It isn't apparent from your examples, but are you passing strings?

For example: dos('command', '-echo');
0
VWrestle97Author Commented:

dos([Batch_Variable Arg1_Variable  Arg2_Variable Arg3_Variable]) is the answer.
0
Steve KnightIT ConsultancyCommented:
Thanks, glad to help.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Programming Languages-Other

From novice to tech pro — start learning today.