Fast comparison of values in array
1 view (last 30 days)
Show older comments
I am using a data acquisition card pulling in data at MHz rates. I am needing to do a comparison of this data and threshold it.
I.E. I have an array of 10,000 variables. I want to find all values less than 50 and set equal to one and everything greater than or equal to 50 as 0.
But I want to continuously do this over and over, as fast as possible. I am current just doing
myResults = data < threshold;
Is there anyway to do this faster? Are there maybe specific sizes of the array that would be faster? Or is there anyway fancy way to make it faster?
It seems to be non mulch-threaded, anyway to make it take advantage of multiple CPUs?
1 Comment
Matt J
on 30 Jun 2014
It should be multi-threaded already. 10000 isn't a very big data size, though, and that may be why you don't see MATLAB firing all thrusters. You should gather a bigger data set before thresholding.
Answers (0)
See Also
Categories
Find more on Whos in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!