Skip to content

Instantly share code, notes, and snippets.

@mp4096
Created April 20, 2016 09:16
Show Gist options
  • Save mp4096/7a934b7fa7a565f76522848e94fc972b to your computer and use it in GitHub Desktop.
Save mp4096/7a934b7fa7a565f76522848e94fc972b to your computer and use it in GitHub Desktop.
Asynchronous processes in MATLAB
function AsyncCall(arg1, arg2)
batchFileLocation = 'mybatch.bat';
cmdArgs = sprintf('""%s" "%s" "%s""', batchFileLocation, arg1, arg2);
proc = System.Diagnostics.Process();
proc.StartInfo.FileName = 'cmd.exe';
proc.StartInfo.Arguments = ['/C', cmdArgs];
proc.StartInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden;
proc.Start();
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment