Select subset of data
Show older comments
Hi. I have this problem, I run into it all the time and the only way I solve it is with a for loop. I am sure there is a simple solution, but I have tried everything I can think of.
I want to select a subset of values. I have for instance calibration data A for frequencies A and I want to select a subset B of these corresponding to frequecies B.
freqA=50:1:100;
dataA=rand(size(freqA));
freqB=50:5:100;
dataB=zeros(size(B));
for k=1:length(B);
dataB(k)=dataA(freqA==freqB(k));
end
This works. But I would like to find a solution that doesn't require a foor loop.
Many thanks in advance!
Accepted Answer
More Answers (0)
Categories
Find more on MATLAB 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!