About resize() function

José Luis García Pallero jgpallero at gmail.com
Thu Oct 23 13:09:08 CDT 2008


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
jgpallero at gmail.com
(o<
/ / \
V_/_
Use Debian GNU/Linux and enjoy!
*****************************************
-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://www-old.cae.wisc.edu/pipermail/help-octave/attachments/20081023/834890b5/attachment.html 


More information about the Help-octave mailing list