Passing variable names to batch script

조회 수: 2 (최근 30일)
Frederik Theissen
Frederik Theissen 2019년 4월 30일
답변: Jeff Miller 2019년 5월 1일
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

답변 (1개)

Jeff Miller
Jeff Miller 2019년 5월 1일
Try
system(['batchfile.bat ', Variable1, ' ', Variable2])

카테고리

Help CenterFile Exchange에서 Entering Commands에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by