help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

About resize() function


From: José Luis García Pallero
Subject: About resize() function
Date: Thu, 23 Oct 2008 20:09:08 +0200

Hi,
Help of resize() function says:

-- Built-in Function:  resize (X, M)
 -- 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.

resize is a built-in function

But in fact, not is a destructive resize, or I didn't understand what *Values in X are not preserved as they are with `reshape'.* means.
For example, if:

a=[1 2;3 4];
resize(a,3,3) returns:

1 2 0
3 4 0
0 0 0

Is the function wrong or the help

--
*****************************************
José Luis García Pallero
address@hidden
(o<
/ / \
V_/_
Use Debian GNU/Linux and enjoy!
*****************************************

reply via email to

[Prev in Thread] Current Thread [Next in Thread]