使用Matlab显示AVI时从键盘获取输入 [英] get input from keyboard while displaying an avi with matlab

查看:158
本文介绍了使用Matlab显示AVI时从键盘获取输入的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好
我写了一个显示avi文件的简短程序.我需要程序在电影运行时(而不是在结束后)从键盘获取输入: 这是我的代码:

Hi all
I wrote a short program that displays an avi file. I need the program to get input from the keyboard while the movie is running (and not after it ends): this is my code:

figure('MenuBar','none')
设置(gcf,'颜色','白色')
set(gca,'Color','white');
set(gca,'XColor','white');
set(gca,'YColor','white');
m = aviread('c:/t1.avi')
a = 30:1:100;
b = 100:-1:30;
c = [a b a b a b a b a b b]%来回播放电影
movie(m,c)%运行电影

figure('MenuBar','none')
set(gcf,'Color', 'white')
set(gca,'Color','white');
set(gca,'XColor','white');
set(gca,'YColor','white');
m=aviread('c:/t1.avi')
a=30:1:100;
b=100:-1:30;
c=[a b a b a b a b a b] %to run the movie back and forth
movie(m,c) %runs the movie

谢谢您的帮助
爱丽儿

Thank you for any help
Ariel

推荐答案

解决方案是使用winopen('c:/filename.avi')

the solution is to use winopen('c:/filename.avi')

winopen('c:/filename.avi')
此命令将打开媒体播放器并在matlab脚本中运行以下命令.它不等待电影结束.它在后台运行.
谢谢大家
阿里尔

winopen('c:/filename.avi')
this command opens media player and runs following commands in the matlab script. it doesn't wait for the movie to end. it runs in the background.
thanks every one
ariel

这篇关于使用Matlab显示AVI时从键盘获取输入的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆