- #1
hoffmann
- 70
- 0
hi all,
i have a list of numbers as follows (list1):
22
26
51
4
740
...
and a two column list of numbers as follows (list2):
1 13
4 9
22 26
33 740
55 1234
the task i want to accomplish is as follows:
if a number from list1 is found in a row in list2, i would like to remove that row from list2. in the above example the numbers 22, 26, 4, and 740 are found in both columns of list2 and i would like to remove rows 2, 3, and 4 of list2. how would i do this in a short MATLAB script?
thanks!
i also have the following code from a prior implementation, but this only works for 2 column arrays. any help would be much appreciated!
kill=[];
for i=1:length(list1)
if list1(i,1) == list2(i,2)
kill = [kill i];
end
end
i have a list of numbers as follows (list1):
22
26
51
4
740
...
and a two column list of numbers as follows (list2):
1 13
4 9
22 26
33 740
55 1234
the task i want to accomplish is as follows:
if a number from list1 is found in a row in list2, i would like to remove that row from list2. in the above example the numbers 22, 26, 4, and 740 are found in both columns of list2 and i would like to remove rows 2, 3, and 4 of list2. how would i do this in a short MATLAB script?
thanks!
i also have the following code from a prior implementation, but this only works for 2 column arrays. any help would be much appreciated!
kill=[];
for i=1:length(list1)
if list1(i,1) == list2(i,2)
kill = [kill i];
end
end