help-octave
[Top][All Lists]
Advanced

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

Re: values in a column vector between two scalars?


From: Martin Helm
Subject: Re: values in a column vector between two scalars?
Date: Fri, 18 Mar 2011 22:52:53 +0100

Am Freitag, den 18.03.2011, 10:01 -0700 schrieb pvkd44:

> How do I make a new column vector D from A, only using the values which lie
> between B and C ?
> 

If b an c are the index values then the following will do (makes no
difference if it is a row or column vector):

octave:1> a = 1:10
a =

    1    2    3    4    5    6    7    8    9   10

octave:2> b=3;c=7;
octave:3> d = a(b:c)
d =

   3   4   5   6   7




reply via email to

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