How to compare two lists

15 views (last 30 days)
Umer Khitab
Umer Khitab on 27 Mar 2018
Commented: Jason on 8 May 2018
i have two lists lets say a=[1 2 3 ] and b =[1 2 3 4 5 ] and i want to compare each element of ' a ' with all elements of "b" it means that 1 is compared with whole list "b" then 2 is compared then 3 and if the element of "a" is member of "b" then output "a"else 0.

Accepted Answer

Walter Roberson
Walter Roberson on 27 Mar 2018
a .* ismember(a, b)
  19 Comments
Walter Roberson
Walter Roberson on 5 Apr 2018
With that test (and the speakers I was using) I could only hear a couple of pops in the mid 20's of Hz, and could not clearly hear a sound until around 33 Hz. Without headphones I would probably not be able to hear your 128 point 5 second sound, and possibly not even with headphones either. I would recommend you at least double your sampling frequency. (But 256 Hz should be fine.)
In what respect are the two files different?
Jason
Jason on 8 May 2018
Greetings, I’ve a similar question, but I'm trying to create a third matrix based on matching pairs of numbers in two other matrices. Current example:
a = [17,9;23,3;24,3;23,3;24,3;9,6;10,6;23,3;24,3;23,3]
b = [17,1;18,1;21,1;23,3;24,3;23,4;24,4;9,6;10,6;14,12;23,12;24,12;23,14]
My goal is to create 'c' where both columns in 'a' and 'b' are the same. So, row 1 of 'a' would be excluded, as would the first 2 rows of 'b', etc. etc.. Any help with accomplishing this task would be greatly appreciated.
Cheers, Jason

Sign in to comment.

More Answers (0)

Categories

Find more on Audio Processing Algorithm Design in Help Center and File Exchange

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!