help-octave
[Top][All Lists]
Advanced

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

Re: fastest way to test a logical vector


From: Dupuis
Subject: Re: fastest way to test a logical vector
Date: Wed, 20 Jan 2010 09:20:16 -0800 (PST)


Carlo de Falco-2 wrote:
> 
> 
> 
>> Regards
>>
>> Pascal
> 
> you could use
> 
> numel (find (x(indi-(1:4)))) >= 2
> 
> c.
> _______________________________________________
> Help-octave mailing list
> address@hidden
> https://www-old.cae.wisc.edu/mailman/listinfo/help-octave
> 
> 

Hello,
I tried to implement most of the logic I needed in the simple, enclosed
file. The results clearly show that replacing 'for' loops by direct work on
vectors is way faster.
http://old.nabble.com/file/p27245361/speedtest.m speedtest.m 

Now my problem is that I'm implementing a kind of state machine. I can write
state(2) as a function of state(1) and so on, but state(1) depends on the
latest state, so direct work on vector would not work. Any idea on how to
solve this ?

Regards

Pascal
-- 
View this message in context: 
http://old.nabble.com/fastest-way-to-test-a-logical-vector-tp27240403p27245361.html
Sent from the Octave - General mailing list archive at Nabble.com.



reply via email to

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