Mercurial > repos > public > sbplib
comparison +anim/updatableLine.m @ 56:ce90abc350c5
Added documentation to setup_1d_plot. Added updatableLine.m
| author | Jonatan Werpers <jonatan@werpers.com> |
|---|---|
| date | Thu, 12 Nov 2015 12:03:45 -0800 |
| parents | |
| children |
comparison
equal
deleted
inserted
replaced
| 55:a8ed986fcf57 | 56:ce90abc350c5 |
|---|---|
| 1 function [update_data, line_handle] = updatableLine() | |
| 2 figure_handle = gcf; | |
| 3 axis_handle = gca; | |
| 4 | |
| 5 line_handle = line(0,0); | |
| 6 | |
| 7 function update(x,y) | |
| 8 if ishandle(figure_handle) && ishandle(axis_handle) | |
| 9 set(line_handle,'XData',x); | |
| 10 set(line_handle,'YData',y); | |
| 11 drawnow | |
| 12 end | |
| 13 end | |
| 14 update_data = @update; | |
| 15 end |
