Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

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


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

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 ]
Abel

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

Thanks Steven_Lord for your detailed answer !

Unfortunately somebody else suggested something like this :

X = [ ...
3 3
11 11
17 17
24 24
33 35
51 51
57 58
64 65];
Y = [...
1 3
10 12
17 24
29 35
41 46
51 58
60 65];

isIn = bsxfun(@ge, X(:,1), Y(:,1).') & bsxfun(@le, X(:,1), Y(:,2).') | ...
bsxfun(@ge, X(:,2), Y(:,1).') & bsxfun(@le, X(:,2), Y(:,2).');

[xi yj] = find(isIn);
Z = [X(xi,:) Y(yj,:)]

But it doesn't work with my version of matlab (7.0.1.24704 (R14) Service Pack 1) or maybe it is just incorrect ; what do you think ?



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

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.