[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
resize
From: |
Francesco Potorti` |
Subject: |
resize |
Date: |
Wed, 30 Jul 2008 17:06:43 +0200 |
What does the resize function do?
Its help string makes one think that it does the same as reshape, only
in place:
-- Built-in Function: resize (X, M, N)
Destructively resize X.
*Values in X are not preserved as they are with `reshape'.*
If only M is supplied and it is a scalar, the dimension of the
result is M-by-M. If M is a vector, then the dimensions of the
result are given by the elements of M. If both M and N are
scalars, then the dimensions of the result are M-by-N.
See also: reshape.
However, it does not do that:
octave> resize((1:3*4)',[3 4])
ans =
1 0 0 0
2 0 0 0
3 0 0 0
Is it a sort of truncation?
--
Francesco Potortì (ricercatore) Voice: +39 050 315 3058 (op.2111)
ISTI - Area della ricerca CNR Fax: +39 050 315 2040
via G. Moruzzi 1, I-56124 Pisa Email: address@hidden
(entrance 20, 1st floor, room C71) Web: http://fly.isti.cnr.it/
- resize,
Francesco Potorti` <=