How do I extract data between a range in an XY array
Afficher commentaires plus anciens
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)]
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Database Toolbox dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!