How to select certain rows from a data set
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Danielle Klawitter
am 25 Jan. 2018
Beantwortet: Walter Roberson
am 25 Jan. 2018
I have a large data set with a data point for every day of the year. I have the first column giving the day of the year (1 to 365) and the 2nd column specifying the day of the week (1 is Sunday, 2 is Monday, etc.) and the 3rd column is the data. I want to analyze the data using only Mondays, Wednesdays and Fridays, aka rows where the 2nd column is 2, 4, or 6. How can I do this?
0 Kommentare
Akzeptierte Antwort
Walter Roberson
am 25 Jan. 2018
mask = ismember(YourData(:,2), [2, 4, 6]);
selected_data = YourData(mask, :);
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu NaNs finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!