Created
March 4, 2015 09:05
-
-
Save shaybensasson/58a225cc6eb382b898ea to your computer and use it in GitHub Desktop.
filter range of values
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%% filter range of values | |
rawData = 1900:5:2100; | |
from = 1982; | |
to_excluded = 2015; | |
indexes = 1:length(rawData); | |
%declare indexes for the whole data range | |
filter = logical(rawData(:) >= from & rawData(:) < to_excluded); | |
%contains 1 where we care | |
indexesOfFilteredData = indexes(filter); | |
%get all the indexes that have 1s | |
filteredData = rawData(indexesOfFilteredData); | |
%filter the data by these indexes |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment