help-octave
[Top][All Lists]
Advanced

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

Logical Indexing in octcdf


From: xnand
Subject: Logical Indexing in octcdf
Date: Sun, 30 May 2010 22:51:52 -0700 (PDT)

Hi everyone.

locations = find(logical(good_var));
svar=var{i}(locations);

In the above code, 'logical' converts the elements of the array good_var
into logicals. 'find' returns indices that evaluate to TRUE. So now,
locations contain indices of non-zero elements of good_var.

In the next statement, svar extracts all the elements of var with the
indices contained in locations.

But the two statements give me the error:
"error: octcdf: indexes must be contiguous"

Thanks,
Nands
-- 
View this message in context: 
http://octave.1599824.n4.nabble.com/Logical-Indexing-in-octcdf-tp2236853p2236853.html
Sent from the Octave - General mailing list archive at Nabble.com.


reply via email to

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