From: Bilal on 16 Jul 2010 09:43 Hi, I wanted to know how to have an infinite loop in Matlab. usually people want to avoid this but I actually want it. I want my program to run continuously until i hit a key, for example "x". How can I manage to have the program exit upon pressing "x"? Bilal
From: Sean on 16 Jul 2010 09:48 "Bilal " <bilalhaider87(a)gmail.com> wrote in message <i1pnl8$jhf$1(a)fred.mathworks.com>... > Hi, > I wanted to know how to have an infinite loop in Matlab. usually people want to avoid this but I actually want it. > I want my program to run continuously until i hit a key, for example "x". How can I manage to have the program exit upon pressing "x"? > Bilal while 1 %do stuff end Don't use x. Use ctrl+c on a PC or cmd+. on a MAC.
From: someone on 16 Jul 2010 09:54 "Bilal " <bilalhaider87(a)gmail.com> wrote in message <i1pnl8$jhf$1(a)fred.mathworks.com>... > Hi, > I wanted to know how to have an infinite loop in Matlab. usually people want to avoid this but I actually want it. > I want my program to run continuously until i hit a key, for example "x". How can I manage to have the program exit upon pressing "x"? > Bilal % Perhaps something like this: x = 1; while x % insert code here if "key is pressed" x = 0; end end
|
Pages: 1 Prev: average of a matrix Next: MATLAB crop something in a figure, how to resolve it? |