Hi,
I'm having issues when running a function from a Guide GUI pushbutton. When I call this function, from a script it runs very quickly. However, if it is called from the GUI , it is very slow. The function (which performs an iterative algorithm) starts very quickly after the press (i.e, I push the button and it begins instantly), but it runs slow. For example, with the script call it takes about 0.1 seconds to complete one iteration, while when called from the GUI it takes about 3 seconds.
I found out if I clear the variables, then re-declare them in the iterative function, it runs very quickly even when called from the GUI:
ie:
func(x,y,z)clear allx=5;y=5;z=5;....
This of course defeats the purpose of passing parameters. I'm looking for a way to clear all and keep a few variables. Note, using the Keep function or clearvars except, won't work in this case. I think "Classes" is where I'm getting garbage, not in the variables, but there is no way to add exceptions to "clear classes". I've also tried save, clear, load, but no success. My next attempt is to save to .txt, clear, then load, but this seems inelegant. Any suggestions?
Best Answer