Creating "sections" of file
Show older comments
I have a file with 5 columns and a lot of rows. The values of the first three columns change every x rows. My goal is to split the file into sections:
0 0 0 x y
0 0 0 x y
0 1 5 x y
0 1 5 x y
0 2 9 x y
0 2 9 x y
.
.
.
So I want to read out the file and give all rows with 0 0 0 the section 1. So if i plot section 1 somehow, matlab will only consider these lines. Section 2 would be every line with 0 1 5 and again matalb will ignore every lines except for section 2 if I plot them. I could build some complicated loops around it, but I was told that matlab has some fancy ways to do something like that. As I said, my file is very big and I have tor ead it multiple times, so loops will slow down my script quite a lot probably. I can choose column 2 or 3 as a default value for the splitting, because these are the values that decide when to start a new section.
Thank you guys
Accepted Answer
More Answers (0)
Categories
Find more on Programming 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!