Filter löschen
Filter löschen

Clear variables of a function when user interrupts the program using CTRL-C

3 Ansichten (letzte 30 Tage)
Hi I've written a GUI toolbox in Matlab. Ones can change input parameters of the program and attain different results. I was searching for a method to clear all variables when program terminates at it's end. I can use clear or clear all in the end of the program but when user tries to interrupt the program intentionally then variables of the program wouldn't be cleared at all. These variables might affect performance of the program when user wants to run the program for second or third time. I'm searching for a way which I can clear all the variables in any program termination case (i.e. reaching to the end line of the program, using CTRL-C by the user and any unforeseen way which can interrupt the program). Can anybody help me?

Akzeptierte Antwort

Walter Roberson
Walter Roberson am 4 Mär. 2014
onCleanup works even for control-C

Weitere Antworten (0)

Kategorien

Mehr zu Get Started with MATLAB finden Sie in Help Center und File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by