myGully.com

myGully.com (https://mygully.com/index.php)
-   Programmierung (https://mygully.com/forumdisplay.php?f=67)
-   -   Eine Animation stoppen (Matlab) (https://mygully.com/showthread.php?t=1948518)

cboerm 30.11.09 22:11

Eine Animation stoppen (Matlab)
 
Hallo,

ich programmiere eine Animation mit m-Files und möchte wenn ein Eingang Null ist, das die Animation in den Stoppmodus geht. Gibt es hierfür einen speziellen Befehl? Ich habe bis jetzt keinen gefunden nur pause und clf.

Ich dachte an folgendes:

if(u(1)>=0)
else
pause(1);
end

und pause dann in Stop oöder ähnliches verwandeln.

nightmare1942 30.11.09 23:06

ich weiß nicht, wie es mit diesem prog läuft, aber normalerweise kann man den ablauf eines codes mit

break;

stoppen. versuch das mal!

cboerm 01.12.09 06:16

Das mit break; funktioniert nicht. Bei Matlab kommt eine Fehlermeldung.

Hast du vielleicht noch eine andere Idee?

nightmare1942 01.12.09 09:18

sry, leider kann ich dir bei diesem prog nicht helfen. ich hab meine animationen immer mit flash programmiert! (action s***** 2/3)

manta656 01.12.09 16:33

das hier , habe ich per google gefunden :
Zitat:

Nothing is easier:


maxtime=(tim lengh of the animation)

tic
for i=1:10000 %main loop

operation

if toc>maxtime
break%end simulation
end

end


notice that "toc" counts the time from the last "tic", so tic goes out the loop and toc inside.
schau mal , ob es das sein könnte ;)

Fantalic 01.10.10 16:05

bei matlab ist das i und j als komplexe zahl definiert. wenn man es in der for schleife benutzt, wird es überschrieben. naja aber wenn du keine komplexen zahlen brauchst auch egal ^^


Alle Zeitangaben in WEZ +1. Es ist jetzt 00:19 Uhr.

Powered by vBulletin® (Deutsch)
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.