Fast comparison of values in array

조회 수: 1 (최근 30일)
Shane
Shane 2014년 6월 30일
편집: Cedric 2014년 6월 30일
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
Matt J
Matt J 2014년 6월 30일
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.

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Whos에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by