# HG changeset patch # User John W. Eaton # Date 1392311257 18000 # Node ID 3afae1432cd67b5ba3fe8bb0c1852c0dd3a35c7b # Parent 35803170227e0abb93f8cd39683c2b5eb72c5767# Parent 9fbea0c395ec88a9a66b6328ef1cd45ff0e3cf27 maint: Periodic merge of gui-release to default. diff -r 35803170227e -r 3afae1432cd6 libinterp/corefcn/load-save.cc --- a/libinterp/corefcn/load-save.cc Thu Feb 13 10:45:55 2014 -0500 +++ b/libinterp/corefcn/load-save.cc Thu Feb 13 12:07:37 2014 -0500 @@ -1151,7 +1151,7 @@ { retval.append (argv[i]); } - else if (argv[i][0] == '-') + else if (argv[i][0] == '-' && argv[i] != "-") { error ("save: Unrecognized option '%s'", argv[i].c_str ()); } diff -r 35803170227e -r 3afae1432cd6 libinterp/corefcn/sparse.cc diff -r 35803170227e -r 3afae1432cd6 scripts/general/private/__isequal__.m --- a/scripts/general/private/__isequal__.m Thu Feb 13 10:45:55 2014 -0500 +++ b/scripts/general/private/__isequal__.m Thu Feb 13 12:07:37 2014 -0500 @@ -82,8 +82,12 @@ ## From here on, compare objects as if they were structures. if (isobject (x)) x = builtin ("struct", x); - varargin = cellfun (@(x) builtin ("struct", x), varargin, - "uniformoutput", false); + for i = 1:numel (varargin) + if (! isobject (varargin{i})) + break; + endif + varargin{i} = builtin ("struct", varargin{i}); + endfor endif if (t) diff -r 35803170227e -r 3afae1432cd6 scripts/image/image.m --- a/scripts/image/image.m Thu Feb 13 10:45:55 2014 -0500 +++ b/scripts/image/image.m Thu Feb 13 12:07:37 2014 -0500 @@ -156,8 +156,8 @@ y = [1, rows(img)]; endif - xdata = x([1, end]); - ydata = y([1, end]); + xdata = x([1, end])(:).'; # (:).' is a hack to guarantee row vector + ydata = y([1, end])(:).'; if (numel (x) > 2 && numel (y) > 2) ## Test data for non-linear spacing which is unsupported diff -r 35803170227e -r 3afae1432cd6 scripts/signal/freqz.m --- a/scripts/signal/freqz.m Thu Feb 13 10:45:55 2014 -0500 +++ b/scripts/signal/freqz.m Thu Feb 13 12:07:37 2014 -0500 @@ -18,6 +18,9 @@ ## -*- texinfo -*- ## @deftypefn {Function File} {[@var{h}, @var{w}] =} freqz (@var{b}, @var{a}, @var{n}, "whole") +## @deftypefnx {Function File} {[@var{h}, @var{w}] =} freqz (@var{b}) +## @deftypefnx {Function File} {[@var{h}, @var{w}] =} freqz (@var{b}, @var{a}) +## @deftypefnx {Function File} {[@var{h}, @var{w}] =} freqz (@var{b}, @var{a}, @var{n}) ## @deftypefnx {Function File} {@var{h} =} freqz (@var{b}, @var{a}, @var{w}) ## @deftypefnx {Function File} {[@dots{}] =} freqz (@dots{}, @var{Fs}) ## @deftypefnx {Function File} {} freqz (@dots{}) @@ -27,10 +30,10 @@ ## respectively. The response is evaluated at @var{n} angular frequencies ## between 0 and ## @ifnottex -## 2*pi. +## 2*pi. ## @end ifnottex ## @tex -## $2\pi$. +## $2\pi$. ## @end tex ## ## @noindent @@ -40,17 +43,16 @@ ## corresponds to a simple FIR filter). ## ## If @var{n} is omitted, a value of 512 is assumed. -## ## For fastest computation, @var{n} should factor into a small number of ## small primes. ## ## If the fourth argument, @qcode{"whole"}, is omitted the response is ## evaluated at frequencies between 0 and ## @ifnottex -## pi. +## pi. ## @end ifnottex ## @tex -## $\pi$. +## $\pi$. ## @end tex ## ## @code{freqz (@var{b}, @var{a}, @var{w})} @@ -66,8 +68,9 @@ ## ## @code{freqz (@dots{})} ## -## Plot the pass band, stop band and phase response of @var{h} rather -## than returning them. +## Plot the magnitude and phase response of @var{h} rather than returning them. +## +## @seealso{freqz_plot} ## @end deftypefn ## Author: jwe ??? @@ -109,11 +112,14 @@ endif endif if (isempty (Fs)) + freq_norm = true; if (nargout == 0) Fs = 2; else Fs = 2*pi; endif + else + freq_norm = false; endif a = a(:); @@ -171,7 +177,7 @@ f_r = f; else ## Plot and don't return values. - freqz_plot (f, h); + freqz_plot (f, h, freq_norm); endif endfunction diff -r 35803170227e -r 3afae1432cd6 scripts/signal/freqz_plot.m --- a/scripts/signal/freqz_plot.m Thu Feb 13 10:45:55 2014 -0500 +++ b/scripts/signal/freqz_plot.m Thu Feb 13 12:07:37 2014 -0500 @@ -17,15 +17,21 @@ ## . ## -*- texinfo -*- -## @deftypefn {Function File} {} freqz_plot (@var{w}, @var{h}) -## Plot the pass band, stop band and phase response of @var{h}. +## @deftypefn {Function File} {} freqz_plot (@var{w}, @var{h}) +## @deftypefnx {Function File} {} freqz_plot (@var{w}, @var{h}, @var{freq_norm}) +## Plot the magnitude and phase response of @var{h}. +## +## If the optional @var{freq_norm} argument is true, the frequency vector +## @var{w} is in units of normalized radians. If @var{freq_norm} is false, or +## not given, then @var{w} is measured in Hertz. +## @seealso{freqz} ## @end deftypefn ## Author: Paul Kienzle -function freqz_plot (w, h) +function freqz_plot (w, h, freq_norm = false) - if (nargin != 2) + if (nargin < 2 || nargin > 3) print_usage (); endif @@ -38,30 +44,26 @@ mag = 20 * log10 (abs (h)); phase = unwrap (arg (h)); - maxmag = max (mag); - subplot (3, 1, 1); - plot (w, mag); - grid ("on"); - legend ("Pass band (dB)"); - axis ([w(1), w(n), maxmag-3, maxmag], "labely"); + if (freq_norm) + x_label = 'Normalized Frequency (\times\pi rad/sample)'; + else + x_label = "Frequency (Hz)"; + endif - subplot (3, 1, 2); + subplot (2, 1, 1); plot (w, mag); grid ("on"); - legend ("Stop band (dB)"); - if (maxmag - min (mag) > 100) - axis ([w(1), w(n), maxmag-100, maxmag], "labely"); - else - axis ("autoy", "labely"); - endif + axis ([w(1), w(n)], "autoy"); + xlabel (x_label); + ylabel ("Magnitude (dB)"); - subplot (3, 1, 3); + subplot (2, 1, 2); plot (w, phase*360/(2*pi)); grid ("on"); - legend ("Phase (degrees)"); - xlabel ("Frequency"); - axis ([w(1), w(n)], "autoy", "label"); + axis ([w(1), w(n)], "autoy"); + xlabel (x_label); + ylabel ("Phase (degrees)"); endfunction diff -r 35803170227e -r 3afae1432cd6 scripts/statistics/distributions/logncdf.m --- a/scripts/statistics/distributions/logncdf.m Thu Feb 13 10:45:55 2014 -0500 +++ b/scripts/statistics/distributions/logncdf.m Thu Feb 13 12:07:37 2014 -0500 @@ -20,13 +20,13 @@ ## -*- texinfo -*- ## @deftypefn {Function File} {} logncdf (@var{x}) ## @deftypefnx {Function File} {} logncdf (@var{x}, @var{mu}, @var{sigma}) -## For each element of @var{x}, compute the cumulative distribution -## function (CDF) at @var{x} of the lognormal distribution with -## parameters @var{mu} and @var{sigma}. If a random variable follows this -## distribution, its logarithm is normally distributed with mean -## @var{mu} and standard deviation @var{sigma}. +## For each element of @var{x}, compute the cumulative distribution function +## (CDF) at @var{x} of the lognormal distribution with parameters +## @var{mu} and @var{sigma}. If a random variable follows this distribution, +## its logarithm is normally distributed with mean @var{mu} and standard +## deviation @var{sigma}. ## -## Default values are @var{mu} = 1, @var{sigma} = 1. +## Default values are @var{mu} = 0, @var{sigma} = 1. ## @end deftypefn ## Author: KH diff -r 35803170227e -r 3afae1432cd6 scripts/statistics/distributions/logninv.m --- a/scripts/statistics/distributions/logninv.m Thu Feb 13 10:45:55 2014 -0500 +++ b/scripts/statistics/distributions/logninv.m Thu Feb 13 12:07:37 2014 -0500 @@ -21,12 +21,12 @@ ## @deftypefn {Function File} {} logninv (@var{x}) ## @deftypefnx {Function File} {} logninv (@var{x}, @var{mu}, @var{sigma}) ## For each element of @var{x}, compute the quantile (the inverse of the -## CDF) at @var{x} of the lognormal distribution with parameters @var{mu} -## and @var{sigma}. If a random variable follows this distribution, its -## logarithm is normally distributed with mean @code{log (@var{mu})} and -## variance @var{sigma}. +## CDF) at @var{x} of the lognormal distribution with parameters +## @var{mu} and @var{sigma}. If a random variable follows this distribution, +## its logarithm is normally distributed with mean @var{mu} and standard +## deviation @var{sigma}. ## -## Default values are @var{mu} = 1, @var{sigma} = 1. +## Default values are @var{mu} = 0, @var{sigma} = 1. ## @end deftypefn ## Author: KH diff -r 35803170227e -r 3afae1432cd6 scripts/statistics/distributions/lognpdf.m --- a/scripts/statistics/distributions/lognpdf.m Thu Feb 13 10:45:55 2014 -0500 +++ b/scripts/statistics/distributions/lognpdf.m Thu Feb 13 12:07:37 2014 -0500 @@ -23,10 +23,10 @@ ## For each element of @var{x}, compute the probability density function ## (PDF) at @var{x} of the lognormal distribution with parameters ## @var{mu} and @var{sigma}. If a random variable follows this distribution, -## its logarithm is normally distributed with mean @var{mu} -## and standard deviation @var{sigma}. +## its logarithm is normally distributed with mean @var{mu} and standard +## deviation @var{sigma}. ## -## Default values are @var{mu} = 1, @var{sigma} = 1. +## Default values are @var{mu} = 0, @var{sigma} = 1. ## @end deftypefn ## Author: KH