From: Martin on 1 Feb 2010 23:01 Hi, I am not sure what would be the most efficient solution to the following problem thus I would greatly appreciate any help. I have few event vectors which I would like to cobine, i.e.: A = [0 0 0 0 1 0 0 0 1 1 0 1 0 0 ... B = [0 0 0 1 0 1 0 0 1 0 0 1 0 0 C = [0 1 0 1 0 0 0 1 0 1 0 0 0 1 ... These vectors store events (to clarify, 1 - event occured). The problem I need to solve is to create vector which will containg event duration. Vector's B and C signals are only valid once there was an event in vector A . In the example above, there was an event triggered at time t=5. This activates vector B (which was listening to A) in which event occured in t=4 and t=6. As event at t=4 occured before any event was registered in vector A, it should be ignored (the same case is true for vector C). Once event in A at t=5 was followed by event in B at t=6, we can start registering event duration in vector D. This should continue until event in C occured (i.e. at t=8 in this case). D = [0 0 0 0 0 1 1 0 1 0 1 1 0 ... The difficulty of the problem is that there can be many vectors (of type B) "listening" for an event in main vector (ie. A). Only when all of them fire, duration starts being recorded until stop event occurs (i.e. vector C at t=8). To make things a bit more complex, stopping criteria can also contain few other signals which have to fire all, to trigger stop recording duration). I hope my explanation is understandable.If not, I would be more than happy to answer any questions regarding this issue. Thank you in advance All the best, Martin
|
Pages: 1 Prev: plotting on an image and saving it Next: matlab ilaplace command question |