How fast is matlab find




















Based on your location, we recommend that you select:. Select the China site in Chinese or English for best site performance. Other MathWorks country sites are not optimized for visits from your location.

Toggle Main Navigation. Search MathWorks. Open Mobile Search. Trial software. Problem Like 3. Solve Later. High performance methods don't appear to incur any increased processing time. Richard Brown on 3 May More Answers 6.

Andrei Bobrov on 3 May Vote 1. Hi Richard! I agree with you. Vote 0. Depending on whether you want the first or the last occurence. Leah on 2 May Matlab has a nice function built in for this. Walter Roberson on 2 May Your suggested code will not work if there are any duplicates, as the find would return multiple values in that case and multiple values cannot be stored into a single numeric array element. Have you considered using the second or third return value from unique?

Thanks guys -- forgot to mention that I need to find the indices for all of the elements if there are multiple occurrences. So simply using "unique" doesn't seem to work. Any other thoughts? Oleg Komarov on 2 May A and J will give you what you want. Not really - J is just A : , but with the unique elements replaced with 1:nUnique.

So it's no better. Geoff on 2 May This comes straight out of some of my own code I guess it's the reverse of what you want though. For every element in M , it gives an index into uM. I use this to reduce columns of data in a matrix that are common to multiple targets.

Answers Support MathWorks. Search Support Clear Filters. Support Answers MathWorks. Search MathWorks. MathWorks Answers Support. Open Mobile Search. Software de prueba. You are now following this question You will see updates in your activity feed. You may receive emails, depending on your notification preferences.

Is there a faster alternative for find operation? Show older comments. Amulya NV on 13 Sep Vote 0. Edited: Amulya NV on 14 Sep Accepted Answer: Guillaume. I have two large vectors X and Y holding indices.

Lets say. I could do that with the use of find as follows. In spite of using parfor, it it still taking a lot of time. Please help me if there is a faster way to achieve this. Cedric Wannaz on 13 Sep Cancel Copy to Clipboard. Why not two 1D cell arrays? Are a and b always in ranges 1:N and 1:M or can they be more arbitrary sets?



0コメント

  • 1000 / 1000