The Math Forum

Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Math Forum » Discussions » Software » comp.soft-sys.matlab

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: Vectorial inclusions inter
Replies: 5   Last Post: Jun 28, 2013 5:57 AM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]

Posts: 31
Registered: 5/29/13
Re: Vectorial inclusions inter
Posted: Jun 28, 2013 5:57 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

And moreover I managed to do it like this :

function Z=original_event(X,Y)


for i = 1 : size(X,1)
for j = 1 : size(Y,1)
if X(i,1)>= Y(j,1) && X(i,2) <= Y(j,2)


It works but it is not fast. The problem is X and Y must contain thousands of datas. So I would like to avoid the for loops. I asked someone to give a try to the solution with bsxfun and it works with its Matlab versions but, according to him, it is slower than my original_event function. So I don't know what to do but I would like to know if there a possiblity to avoid any loops, or to combine them in some ways.

Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© The Math Forum at NCTM 1994-2018. All Rights Reserved.