help-octave
[Top][All Lists]
Advanced

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

Re: About resize() function


From: José Luis García Pallero
Subject: Re: About resize() function
Date: Fri, 24 Oct 2008 10:24:01 +0200

Ok, but the fact that some elements are not preserved if the new matrix is samaller is logical. I think that the help of the function is quite confused.

2008/10/24 Bill Denney <address@hidden>
José Luis García Pallero wrote:
> 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
Both are correct if you do things a little differently.  Values are not
preserved if you make the matrix smaller.  Try the following:

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

Have a good day,

Bill



--
*****************************************
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]