I used winopen('filename')
to open an AVI file using the Windows Medi开发者_Python百科a Player. How can I close it?
There is tkill
command on Windows to kill a task. You can use it with system()
. You have to find a method to kill only "your" WMP if several can coexist.
If you want to control movie playback in MATLAB, use MATLAB itself to play the movie.
You can use mmreader to do this. An example is provided in the documentation.
Note that in older versions of MATLAB, you'll need to use aviread
instead. Also, as mentioned in the above link, mmreader
is being renamed to VideoReader
in future versions of MATLAB.
Might be tough to do easily. I thought there would be a way using Matlab's dos command and the appropriate parameters, but the recent version of WMP doesn't have a close after play command (see WMP Command Line Parameters). This is odd, since I found older documentation that does reference a /close parameter, but it doesn't work with Win7.
If you are desperate, you should be able to use the COM interface to get it done, but this is a trickier task.
精彩评论