Mercurial > repos > public > sbplib
annotate +draw/prompt_point.m @ 609:8cbecf22075b feature/utux2D
Merge to get interpolation operators.
author | Martin Almquist <malmquist@stanford.edu> |
---|---|
date | Sat, 14 Oct 2017 22:36:31 -0700 |
parents | 48b6fb693025 |
children | 00eb5db89da5 |
rev | line source |
---|---|
0 | 1 function [p, button] = prompt_point(s,varargin) |
2 default_arg('s',[]) | |
3 | |
4 set(gcf,'Pointer','crosshair') | |
5 | |
6 if ~isempty(s) | |
7 fprintf(s,varargin{:}); | |
8 end | |
9 | |
10 a = gca; | |
11 | |
12 function get_point(src,event) | |
13 cp = a.CurrentPoint; | |
14 p = cp(1,1:2)'; | |
15 a.ButtonDownFcn = []; | |
16 end | |
17 | |
18 a.ButtonDownFcn = @get_point; | |
19 waitfor(a,'ButtonDownFcn', []) | |
20 | |
21 set(gcf,'Pointer','arrow') | |
22 | |
23 end |