1 |
% |
---|
2 |
% MARKCCW mark Counter Clockwise oriented ellipses with *'s at centers |
---|
3 |
% |
---|
4 |
% The OPNML function TELLIPSE (or ELLIPSE) must have been run |
---|
5 |
% before MARKCCW will work. |
---|
6 |
% |
---|
7 |
% Input: Marker type (optional, default = '*') |
---|
8 |
% Output: MARKCCW returns the handle to the *'s plotted. |
---|
9 |
% |
---|
10 |
% Call as: h=markccw(markerstyle); |
---|
11 |
% |
---|
12 |
function h=markccw(markerstyle) |
---|
13 |
|
---|
14 |
% |
---|
15 |
%...Check input argument |
---|
16 |
if nargin>1 |
---|
17 |
error('Wrong number of inputs to MARKCCW.'); |
---|
18 |
else |
---|
19 |
if nargin==0 |
---|
20 |
markerstyle='*'; |
---|
21 |
elseif ~isstr(markerstyle) |
---|
22 |
error('Input to MARKCCW must be a string marker style (i.e., ''+'')'); |
---|
23 |
else |
---|
24 |
if ~strcmp(markerstyle,'*')|... |
---|
25 |
~strcmp(markerstyle,'+')|... |
---|
26 |
~strcmp(markerstyle,'o') |
---|
27 |
error('Input to MARKCCW must be one of (*,+,o).') |
---|
28 |
end |
---|
29 |
end |
---|
30 |
end |
---|
31 |
|
---|
32 |
% |
---|
33 |
%...Find ellipse object in current axes |
---|
34 |
hell=findobj(gca,'Type','line','Tag','ellipse data'); |
---|
35 |
if isempty(hell) |
---|
36 |
error('No ellipse object in current axes.'); |
---|
37 |
end |
---|
38 |
|
---|
39 |
% |
---|
40 |
%...Extract UserData from ellipse object |
---|
41 |
data=get(hell,'UserData'); |
---|
42 |
|
---|
43 |
% |
---|
44 |
%...Extract Ellipse centers and Minor axis lengths from ellipse object |
---|
45 |
xc=data(:,1); |
---|
46 |
yc=data(:,2); |
---|
47 |
UMINOR=data(:,4); |
---|
48 |
|
---|
49 |
% |
---|
50 |
%...Remove trailing NaN from centers and UMINOR |
---|
51 |
xc=xc(1:length(xc)-1); |
---|
52 |
yc=yc(1:length(yc)-1); |
---|
53 |
UMINOR=UMINOR(1:length(UMINOR)-1); |
---|
54 |
|
---|
55 |
% |
---|
56 |
%...CCW ellipses |
---|
57 |
ccw=find(UMINOR>0); |
---|
58 |
|
---|
59 |
% |
---|
60 |
%...Plot *'s at ellipse centers whose orientation is ccw |
---|
61 |
h=line(xc(ccw),yc(ccw),'Linestyle',markerstyle,'Color','r','Tag','ccw ellipse centers'); |
---|
62 |
return |
---|
63 |
% |
---|
64 |
% Brian O. Blanton |
---|
65 |
% Curriculum in Marine Science |
---|
66 |
% Ocean Processes Numerical Modeling Laboratory |
---|
67 |
% 15-1A Venable Hall |
---|
68 |
% CB# 3300 |
---|
69 |
% Uni. of North Carolina |
---|
70 |
% Chapel Hill, NC |
---|
71 |
% 27599-3300 |
---|
72 |
% |
---|
73 |
% 919-962-4466 |
---|
74 |
% blanton@marine.unc.edu |
---|
75 |
% |
---|
76 |
% February 1995 |
---|
77 |
% |
---|
78 |
|
---|