help-octave
[Top][All Lists]
Advanced

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

Re: vector handles


From: Doug Stewart
Subject: Re: vector handles
Date: Fri, 12 Nov 2010 11:43:50 -0500



On Fri, Nov 12, 2010 at 11:00 AM, george.brida <address@hidden> wrote:

Hi all,
suppose that we have the following vector u=[10 11 12 14 15 14 10 11 12 14 15 17 20 21 20 23]' of length 16. I would like to create  the following vectors:
u_1 composed by the elements number 1, 5, 9 and 13 of u
u_2 composed by the elements number 2, 6, 10 and 14 of u
u_3 composed by the elements number 3, 7, 11 and 15 of u
u_4 composed by the elements number 4, 8, 12 and 16 of u
can you help me with a program performing this task. Thank you very much in advance.
George.



Pieddemail
_______________________________________________
Help-octave mailing list
address@hidden
https://www-old.cae.wisc.edu/mailman/listinfo/help-octave


There are many ways to do this. Here is one way:

u=[10 11 12 14 15 14 10 11 12 14 15 17 20 21 20 23]'

u_1=u(1:4:16)

u_2=u(2:4:16)

u_3=u(3:4:16)

u_4=u(4:4:16)

Doug Stewart


reply via email to

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