Mercurial > hg > octave-lyh
comparison scripts/statistics/base/qqplot.m @ 3456:434790acb067
[project @ 2000-01-19 06:58:51 by jwe]
author | jwe |
---|---|
date | Wed, 19 Jan 2000 06:59:23 +0000 |
parents | 71d2e09c15a2 |
children | e031284eea27 |
comparison
equal
deleted
inserted
replaced
3455:f758be6e1730 | 3456:434790acb067 |
---|---|
37 ## @end example | 37 ## @end example |
38 ## | 38 ## |
39 ## If no output arguments are given, the data are plotted directly. | 39 ## If no output arguments are given, the data are plotted directly. |
40 ## @end deftypefn | 40 ## @end deftypefn |
41 | 41 |
42 ## Author: KH <Kurt.Hornik@ci.tuwien.ac.at> | 42 ## Author: KH <Kurt.Hornik@ci.tuwien.ac.at> |
43 ## Description: Perform a QQ-plot (quantile plot) | 43 ## Description: Perform a QQ-plot (quantile plot) |
44 | 44 |
45 function [q, s] = qqplot (x, dist, ...) | 45 function [q, s] = qqplot (x, dist, ...) |
46 | 46 |
47 if (nargin < 1) | 47 if (nargin < 1) |
48 usage ("qqplot (x [,dist [,params]])"); | 48 usage ("qqplot (x, dist, params)"); |
49 endif | 49 endif |
50 | 50 |
51 if !(is_vector(x)) | 51 if !(is_vector(x)) |
52 error ("qqplot: x must be a vector."); | 52 error ("qqplot: x must be a vector."); |
53 endif | 53 endif |
54 | 54 |
55 s = sort (x); | 55 s = sort (x); |
56 n = length (x); | 56 n = length (x); |
57 t = ((1 : n)' - .5) / n; | 57 t = ((1 : n)' - .5) / n; |