How do I extract data between a range in an XY array
Show older comments
I've been using MATLAB for a while but can't seem to find an efficient way of selecting XY data between a range.
I have a large physical data set imported which is an array of XY data points, I've tried to fake a section below:
dummyXYArray = [transpose([0:1:10]) rand(11,1)];
How do I return a similarly formed array with only data between 2<x_desired<7
My slow way requires tons of steps:
xDataDummyXYArray = dummyXYArray(:,1);
yDataDummyXYArray = dummyXYArray(:,2);
clippingArray = xDataDummyXYArray>2 & xDataDummyXYArray<7;
clippedArray = [xDataDummyXYArray(clippingArray) yDataDummyXYArray(clippingArray)]
Accepted Answer
More Answers (0)
Categories
Find more on Database Toolbox 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!