A possible way to verify if a variable changed after a program was restarted is to save the variable in a file at the end of program execution and compare its contents at the beginning of the next execution. Here is an example of how to create such a method in MATLAB:
main.m1040 chars30 lines
To use this method, you just need to call it passing the name of the variable you want to check, like this:
main.m186 chars6 lines
In the example above, the first call to is_variable_changed
will return false because there was no previous execution of the program, and the variable variable_to_check
was just created. The second call will return true because the variable was updated, and different from the one saved in the previous execution.
gistlibby LogSnag