hi all,(adsbygoogle = window.adsbygoogle || []).push({});

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

**Physics Forums - The Fusion of Science and Community**

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

# MATLAB: deleting rows

Loading...

Similar Threads - MATLAB deleting rows | Date |
---|---|

Python How can I run Python by getting values from Matlab | Mar 7, 2018 |

What is each step of this Matlab program doing? | Feb 21, 2018 |

C/++/# Help with MATLAB code? | Feb 9, 2018 |

Numerical Integration with variable limits MATLAB | Jan 15, 2018 |

**Physics Forums - The Fusion of Science and Community**