Passing variable names to batch script

2 Ansichten (letzte 30 Tage)
Frederik Theissen
Frederik Theissen am 30 Apr. 2019
Beantwortet: Jeff Miller am 1 Mai 2019
Hi Guys,
I want to pass multiple variables to a batch script from MATLAB using the sytem command:
system(['batchfile.bat ', Variable1])
In the batch file I can then define
set V1 =%1
However, I do not understand how to pass a second variable?
If I do for example:
system(['batchfile.bat ', Variable1, Variable2])
it simply merges Variable1 and Variable2 as Variable1Variable2
Is there a better way to define multiple variables from MATLAB for use in my batch script?
Thanks
F

Antworten (1)

Jeff Miller
Jeff Miller am 1 Mai 2019
Try
system(['batchfile.bat ', Variable1, ' ', Variable2])

Kategorien

Mehr zu Entering Commands finden Sie in Help Center und File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by