help-octave
[Top][All Lists]
Advanced

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

Re: find


From: James Sherman Jr.
Subject: Re: find
Date: Thu, 4 Jun 2009 12:15:01 -0400

If you really need have it done in one line, I'd just write a function to do what you're doing in two lines.  Or are you worried about find taking too long?

On Thu, Jun 4, 2009 at 11:26 AM, Carlo Rossi <address@hidden> wrote:

Hello,


class = [1  1 1 -1 -1 1];

This is is what I need:

idx1 = find(class == 1); %retrieve the indexes of '1': 1,2,3,6
idx2 = find(class == -1); % retrieve 4,5

But I'd like to know if it's possible write it in a hit (and I need 2 different variables, id2, idx2)

[idx1, idx2] = find(class == 1;  class == -1) %this dosn't work.

thanks,








reply via email to

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