summaryrefslogtreecommitdiff
path: root/macros
diff options
context:
space:
mode:
Diffstat (limited to 'macros')
-rw-r--r--macros/prepad.sci3
1 files changed, 3 insertions, 0 deletions
diff --git a/macros/prepad.sci b/macros/prepad.sci
index 52d9746..4e517f8 100644
--- a/macros/prepad.sci
+++ b/macros/prepad.sci
@@ -51,6 +51,9 @@ function y = prepad (x, l, c, dim)
if (argn(2) < 4)
// Find the first non-singleton dimension.
dim = find (sz > 1, 1)
+ if (dim == [])
+ dim = 1
+ end
else
if (~(isscalar (dim) & dim == fix (dim) & dim >= 1))
error ("prepad: DIM must be an integer and a valid dimension");