Mercurial > hg > octave-nkf
diff scripts/signal/unwrap.m @ 12674:9493880928c8
Use common idiom in m-files for finding first non-singleton dimension.
* flipdim.m, postpad.m, prepad.m, shift.m, unwrap.m: Use common idiom in
m-files for finding first non-singleton dimension.
author | Rik <octave@nomad.inbox5.com> |
---|---|
date | Sun, 15 May 2011 08:58:49 -0700 |
parents | c792872f8942 |
children | 2783fa95cab7 |
line wrap: on
line diff
--- a/scripts/signal/unwrap.m +++ b/scripts/signal/unwrap.m @@ -55,11 +55,8 @@ error ("unwrap: DIM must be an integer and a valid dimension"); endif else - ## Find the first non-singleton dimension - dim = find (sz > 1, 1); - if (isempty (dim)) - dim = 1; - endif + ## Find the first non-singleton dimension. + (dim = find (sz > 1, 1)) || (dim = 1); endif rng = 2*pi;