Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Scilab in array

2 views
Skip to first unread message

nathan...@gmail.com

unread,
Nov 25, 2009, 4:06:05 AM11/25/09
to
Hi,

Is there a way to check if a given variable x is in the vector v?

Like:
"if u(k, 1) = [1,2,3,4,5,6,7,8,9]"

Thanks in advance,
Nathan

Francois Vogel

unread,
Nov 25, 2009, 4:10:44 AM11/25/09
to
nathan...@gmail.com said on 25/11/2009 10:06:

> Is there a way to check if a given variable x is in the vector v?

v=[1,2,3,4,5,6,7,8,9];
x=1;find(v==x)<>[]
x=11;find(v==x)<>[]

Francois

0 new messages