forked from robEllenberg/MATLAB
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmatlabsecrets.txt
23 lines (19 loc) · 886 Bytes
/
matlabsecrets.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
This is a list of little tricks and helpful hint's I've picked up. Right now
it's just a scratch pad, but eventually it will be roganized properly, maybe
even a latex project.
Animation functions
1) Make it so that the user has a way to cancel the animation neatly. One
issue with overloading the CloseRequestFcn is that if the program throws an
error, that function is thrown out of memory. The below way simply aborts the
loop if the handle is no longer valid.
while
h=renderFrame()
if ~ishandle(h)
break;
end
end
2) Use refreshdata if possible, rather than clearing and recreating the plot
from scratch. The renderFrame function should take an optional handle as an
argument. If it's not passed in, it should initialize a plot window (or if
it's not valid). If it is, use the set function to update the data in the plot
('XData', etc.)