Mercurial > hg > octave-lyh
comparison scripts/set/create_set.m @ 4862:a0997c4d1d54
[project @ 2004-04-15 21:14:43 by jwe]
author | jwe |
---|---|
date | Thu, 15 Apr 2004 21:14:44 +0000 |
parents | e6d0041aedf3 |
children | c08cb1098afc |
comparison
equal
deleted
inserted
replaced
4861:fbb15372830c | 4862:a0997c4d1d54 |
---|---|
40 endif | 40 endif |
41 | 41 |
42 if (isempty(x)) | 42 if (isempty(x)) |
43 y = []; | 43 y = []; |
44 else | 44 else |
45 [nrx, ncx] = size (x); | 45 nel = numel (x); |
46 nelx = nrx * ncx; | 46 y = sort (reshape (x, 1, nel)); |
47 y = sort (reshape (x, 1, nelx)); | 47 els = find (y(1:nel-1) != y(2:nel)); |
48 els = find (y(1:nelx-1) != y(2:nelx)); | |
49 if (isempty (els)); | 48 if (isempty (els)); |
50 y = y(1); | 49 y = y(1); |
51 else | 50 else |
52 y = y([1, els+1]); | 51 y = y([1, els+1]); |
53 endif | 52 endif |