help-octave
[Top][All Lists]
Advanced

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

Re: Extracting segents of data from array


From: Ben Abbott
Subject: Re: Extracting segents of data from array
Date: Mon, 03 Jan 2011 13:26:58 -0500

On Jan 3, 2011, at 1:13 PM, lciotti wrote:

> I have a large array that I want to extract specific rows from.
> 
> Specifically I want to extract data from every 9th row as well as the one
> before and the one after starting at the 100th row.  What is the quickest
> way to do this?
> 
> Thanks

If your original array is "a" ...

        n = 100:9:rows(a);
        n = union (union (n, n-1), n+1);
        b = a(n,:);

... "b" contains the extracted data.

Ben




reply via email to

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