help-octave
[Top][All Lists]
Advanced

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

Re: element extraction from vector


From: Jaroslav Hajek
Subject: Re: element extraction from vector
Date: Fri, 8 Jan 2010 22:04:40 +0100

On Fri, Jan 8, 2010 at 9:46 PM, hassen ben Thabet <address@hidden> wrote:
> My discussion concerns some handling of a large number of columns of a
> matrix. In fact, I have a matrix A of size (100,20000). Each column of A is
> composed of -1, 0 and 1. Each passages from -1 to 1 define an expansion for
> each column. The duration of each expansion is the subtraction of the index
> of 1 that of (-1) (Obviously, the involving elements 1 and -1 in this
> expansion). Similarly, each passage from 1 to -1 defines a recession, for
> each column.
> The duration of each recession is the subtraction of the index (-1) that of
> 1. I would say by the index, the number of observation in the column.
> To better clarify, I give the following example:
> u is the vector containing 10 observations:
> [1 0 0 0 0 -1 0 -1 0 1] '
> In this vector u there is a recession: the passage of the first element of
> the vector (which is 1) to the 6th element (which is -1) and duration of
> this recession is 6-1 = 5.
> In this vector u there is an expansion: the passage of the 8th element which
> is -1 to the 10th element which is 1. The duration of this expansion is 10-8
> = 2.
> Is there someone who can help me with a program that can determine, for each
> column of my matrix A, the different expansions, the different recessions
> and their durations. In a preceding discussion, Vic has proposed an
> excellent code doing this task for each column but I would like to obtain
> the results in a whole matrix for the total number of columns (20000).
> Many thanks in advance.
> Hassen.
>

And in what form you would like to get the result? The numbers of
expansions/recessions will be different for different columns.

-- 
RNDr. Jaroslav Hajek, PhD
computing expert & GNU Octave developer
Aeronautical Research and Test Institute (VZLU)
Prague, Czech Republic
url: www.highegg.matfyz.cz


reply via email to

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