Revision 495
(checked in by cbc, 12 years ago)
|
Initial import of Stark code.
|
Line | |
---|
1 |
function Vo=getlevels(Z,V); |
---|
2 |
% GETLEVELS Computes vector of levels for contouring purposes |
---|
3 |
% V=getlevels(Z,V) takes the input Z matrix and V argument, |
---|
4 |
% and computes the same V vector generated by the built-in |
---|
5 |
% contouring routines. This is necessary for compatability |
---|
6 |
% reasons. |
---|
7 |
|
---|
8 |
% Author: R. Pawlowicz (IOS) rich@ios.bc.ca |
---|
9 |
% 16/mar/95 |
---|
10 |
|
---|
11 |
if (length(V) <= 1) % Get default contour levels if needed |
---|
12 |
minz = min(min(Z(finite(Z)))); |
---|
13 |
maxz = max(max(Z(finite(Z)))); |
---|
14 |
if isempty(V) CS=contourc([minz maxz ; minz maxz]); |
---|
15 |
else CS=contourc([minz maxz ; minz maxz],V); |
---|
16 |
end |
---|
17 |
ii = 1; % Find the levels |
---|
18 |
Vo = []; |
---|
19 |
while (ii < size(CS,2)), |
---|
20 |
Vo=[Vo CS(1,ii)]; |
---|
21 |
ii = ii + CS(2,ii) + 1; |
---|
22 |
end |
---|
23 |
else |
---|
24 |
Vo=sort(V); % return in ascending order otherwise filling may not work properly |
---|
25 |
end |
---|