Reputation: 777
I have a Matlab script which records a person speaking a phone number then finds where each number is spoken. Basically, I have the index within the main file where a smaller file is spoken; sometimes the smaller file can be found twice.
I have the indexes all the locations of '0', say they are 200 and 350. Now I find the indexes of '1', say 100 and 250. How can I reconstruct the phone number based on these indexes? The final answer should be '1010'. Can I have an array of tuples or something like:
x(1)=(200,0)
x(2)=(350,0)
x(3)=(100,1)
x(4)=(250,1)
Then sort them by their first element? If that is possible, I do not know the correct syntax. I hope this makes sense. Any help?
Upvotes: 1
Views: 45