How can I control external programs with Matlab?

3 ビュー (過去 30 日間)
Reva
Reva 2013 年 7 月 15 日
I'm running a student version of Matlab on my Macbook. My goal right now is to create a program that will function as a DJ generally would when playing party games like hot potato and musical chairs.
I'm trying to create code that will start playing music (in an external program like iTunes, QuickTime Player, or MPlayerX) and then pause it randomly to play the game. I've had luck opening files using unix. Other than that, I'm at a loss for how to pause or just stop the music and then open another song to keep going.
This is the code I've figured out for opening files in iTunes or the like (note: it's specific to my computer because of the directory, this code will work on other computers with other songs, the directory just needs to be changed):
unix('open -a iTunes.app "/Users/revascharf/Music/iTunes/iTunes Media/Music/Lou Bega/A Little Bit of Mambo/01 Mambo No. 5 (A Little Bit Of...).mp3"')
When run without suppression, it'll return 0, because it has executed it's command. However, open seems to be the only command I can figure out. I'm a rookie programmer (Matlab is the only language I know) and I don't have any experience trying to access the shell and whatnot. Any input would be greatly appreciated!

回答 (0 件)

カテゴリ

Help Center および File ExchangeJust for fun についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by