Loop query

Loop query

Post by Tanmaya S Bhatnag » Wed, 06 Jul 1994 21:05:34



One of the callbacks for a uicontrol in my code executes a loop until
another button is pressed.  This works fine if no axes modifications
(e.g., plots, fills) are in the loop.

But, if there are axes modifications, then they are NOT executed until
I use a keyboard interrupt.  The present solution is to introduce a
pause(fraction_of_second).  This doesn't seem very clean.

Is there any way to prevent the loop from repeating until the axes
are updated?

                                        -- Tan

 
 
 

Loop query

Post by Loren Shu » Wed, 06 Jul 1994 22:18:49




> One of the callbacks for a uicontrol in my code executes a loop until
> another button is pressed.  This works fine if no axes modifications
> (e.g., plots, fills) are in the loop.

> But, if there are axes modifications, then they are NOT executed until
> I use a keyboard interrupt.  The present solution is to introduce a
> pause(fraction_of_second).  This doesn't seem very clean.

> Is there any way to prevent the loop from repeating until the axes
> are updated?

Insert a DRAWNOW command into your polling loop.  Then the pending graphics
will get updated.



     24 Prime Park Way                http://www.mathworks.com
     Natick, MA 01760-1500                   ftp.mathworks.com
==== Tel: 508-653-1415 ==== Fax: 508-653-2997 =====================

 
 
 

1. While Loop not Looping Correctly

Can someone please help me to see what is wrong with my following
codes.  It's not looping correctly.
-------------
clear all
vstall=72      
bank_angle=45/180*pi
percentage = 1.0
counter =0

while percentage <=1.2
counter=counter+1

turn_speed = percentage*vstall/cos(bank_angle)^0.5*5280/3600;
percentage = percentage + 0.10

end
-----------------
The counter value is 2 and percentage is 1.2. Shouldn't the counter be
3, since at percentage=1.2, it should still go through another round
BUT the While Loop stops at 1.2, EVEN THOUGH I set it for <=1.2 (less
than or EQUAL to) in line 7.  I would have thought the following
happens;
1st loop, percentage =1.0, counter = 1
2nd loop, percentage =1.1, counter = 2
3rd loop, percentage = 1.2, counter =3
stop.

On the other hand, it loops correctly if while percentage <=1.1.

Thanks for taking a look at this.
Confused & bewildered.

2. boot failure

3. looped loop, maz-min envelope

4. Database and ASP.NET

5. "While" loop not looping

6. Which one to buy: revoplus or 5mx?

7. Querying for program(s) associated with an extension

8. AD WEB Solution

9. Generic query: System() arguments?

10. SQL Query in database toolbox

11. fmincon query

12. Simulink Clock Rollover query

13. adding memory: a query