| MATLAB Central > MATLAB Newsreader > Nested Function Error? |
|
|
|
Currently, I am trying to design a GUI that has a running clock. I assumed that the best way to do it is the make a master function, "Garbage," start an infinite while loop, and embed all of the callbacks for my GUI in the infinite loop. For some reason, MATLAB doesn't like while statements that stretch across the entire program, because it says that it is an invald use of the function keyword. Any and all help would be greatly appreciated. |
|
It is true that you cannot define this kind of function in a while loop. |
|
Subject: Nested Function Error? From: Shanmugam Kannappan Date: 17 Jul, 2009 05:07:01 Message: 3 of 5 |
|
"Bill " <millerwd@notes.udayton.edu> wrote in message <h3okt9$bng$1@fred.mathworks.com>... |
|
Shan, the reason why I wanted KeyPressFcn in the while loop was because I'm trying to have a running timer in the GUI I am using. The problem is that while this clock is running, I need to be able to do other things, press other buttons, etc., and also at the same time be able to pause/stop the clock if need be. I not understand that I cannot nest GUI functions in a While Loop, but I am still without a solution. Currently, my solution, enclosed below works in terms of updating the clock, but fails to properly execute the stop and pause commands. |
|
help TIMER |
A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.
Anyone can tag a thread. Tags are public and visible to everyone.
| Tag Activity for This Thread | ||
|---|---|---|
| Tag | Applied By | Date/Time |
| nested functions | Sprinceana | 17 Jul, 2009 03:33:04 |
Contact us at files@mathworks.com
