Revision 495
(checked in by cbc, 12 years ago)
|
Initial import of Stark code.
|
Line | |
---|
1 |
% |
---|
2 |
% SCRANGE return the min and max of the input array |
---|
3 |
% |
---|
4 |
% scrange(x) returns the min and max of the input array. |
---|
5 |
% If x is a vector, SCRANGE returns the minimum and |
---|
6 |
% maximum values. |
---|
7 |
% If x is a matrix, SCRANGE returns the minimum and |
---|
8 |
% maximum values of each column. |
---|
9 |
% |
---|
10 |
% SCRANGE is most useful in determining the range of vector |
---|
11 |
% data to be passed to LCONTOUR2. |
---|
12 |
% |
---|
13 |
% Example: >> x = 1:10; |
---|
14 |
% >> scrange(x) |
---|
15 |
% min = 1 |
---|
16 |
% max = 10 |
---|
17 |
% |
---|
18 |
% Calls: none |
---|
19 |
% |
---|
20 |
% Written by : Brian O. Blanton |
---|
21 |
% |
---|
22 |
function scrange(data) |
---|
23 |
|
---|
24 |
[m,n]=size(data); |
---|
25 |
|
---|
26 |
if m==1 | n==1 |
---|
27 |
data=data(:); |
---|
28 |
disp(' ') |
---|
29 |
disp(['min = ' num2str(min(data),8)]); |
---|
30 |
disp(['max = ' num2str(max(data),8)]); |
---|
31 |
disp(' ') |
---|
32 |
else |
---|
33 |
minimum=min(data) |
---|
34 |
maximum=max(data) |
---|
35 |
end |
---|
36 |
|
---|
37 |
return |
---|
38 |
% |
---|
39 |
% Brian O. Blanton |
---|
40 |
% Curr. in Marine Science |
---|
41 |
% 15-1A Venable Hall |
---|
42 |
% CB# 3300 |
---|
43 |
% Uni. of North Carolina |
---|
44 |
% Chapel Hill, NC |
---|
45 |
% 27599-3300 |
---|
46 |
% |
---|
47 |
% 919-962-4466 |
---|
48 |
% blanton@marine.unc.edu |
---|