source: MML/trunk/applications/orbit/lib/intland.m @ 4

Last change on this file since 4 was 4, checked in by zhangj, 10 years ago

Initial import--MML version from SOLEIL@2013

File size: 301 bytes
Line 
1function [n1,v1]=intland(v1,v2)
2%find the intersection of two integer arrays
3if isempty(v1) | isempty(v2)
4    n1=0;
5    v1=[];
6    return
7end
8
9%for each entry in v1, check if contained in v2
10for ind=1:length(v1)
11if isempty(find(v2==v1(ind)))
12v1(ind)=0;
13end
14end
15
16v1=sort(v1(find(v1)));
17n1=length(v1);
Note: See TracBrowser for help on using the repository browser.