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: Sun, 10 Jan 2010 13:19:50 +0100

On Fri, Jan 8, 2010 at 10:24 PM, hassen ben Thabet <address@hidden> wrote:
> That's the main problem, we have not the same number of expansions and
> recessions and I want to study the number of recessions/expansions for each
> column and the average of duration of expansion/recession. For each column,
> the average of duration of a recession is the sum of durations of recessions
> divided by the number of recessions.
>

I think you could extract the nonzero elements and their column
indices using find, compute the jumps using diff and discard invalid
ones, then use accumarray by column indices to compute sums, counts or
possibly other reductions.

A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing in e-mail?

hth

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