필터 지우기
필터 지우기

How can I run an automated script for command prompt in Matlab?

조회 수: 2 (최근 30일)
Joseph
Joseph 2013년 8월 1일
Hi,
I have a custom built Matlab code which has a GUI for the user. The code can open command prompt and the user then has to type in some commands to allow a piece of hardware to run. the commands are actually very easy, but I'm trying to make the code as user-friendly as possible, so that anyone can use it. So I'm looking for a way of automating the commands that need to be done in command prompt and I need help. I have heard of using javascript files and cscript to automate command prompt, but there isn't much help out there on how to actually write these files, and I also don't know how you would get matlab to run a .js file.
Help would be much appreciated!
Thanks, Joe

채택된 답변

Iain
Iain 2013년 8월 1일
If you mean "DOS" prompt, then why not create a batch file (*.bat), and fill it with the commands you need, and then issue the system command to execute that file.
You can call dos commands (& I believe, batch files) via the "BANG" operator (!), or via a system call (doc system)
Try these at matlab command line:
!dir &
!dir

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 File Operations에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by