?
Solved

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

Posted on 2008-02-07
10
Medium Priority
?
1,833 Views
Last Modified: 2016-02-10
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?
0
Comment
Question by:VWrestle97
  • 4
  • 3
  • 2
  • +1
10 Comments
 
LVL 28

Assisted Solution

by:TextReport
TextReport earned 480 total points
ID: 20839996
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
 

Author Comment

by:VWrestle97
ID: 20843325
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
 
LVL 28

Assisted Solution

by:TextReport
TextReport earned 480 total points
ID: 20843386
Have you tried without the comma?

dos(Batch_Variable Arg1_Variable Arg2_Variable Arg3_Variable)

Cheers, Andrew
0
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 

Author Comment

by:VWrestle97
ID: 20843412
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
 

Author Comment

by:VWrestle97
ID: 20843452
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
 
LVL 28

Assisted Solution

by:TextReport
TextReport earned 480 total points
ID: 20843699
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
 
LVL 43

Accepted Solution

by:
Steve Knight earned 640 total points
ID: 20849322
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
 
LVL 1

Assisted Solution

by:jscroft
jscroft earned 80 total points
ID: 20850701
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
 

Author Comment

by:VWrestle97
ID: 20878114

dos([Batch_Variable Arg1_Variable  Arg2_Variable Arg3_Variable]) is the answer.
0
 
LVL 43

Expert Comment

by:Steve Knight
ID: 20878380
Thanks, glad to help.
0

Featured Post

The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
Article by: evilrix
Looking for a way to avoid searching through large data sets for data that doesn't exist? A Bloom Filter might be what you need. This data structure is a probabilistic filter that allows you to avoid unnecessary searches when you know the data defin…
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
Suggested Courses

601 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question