title: isolating data in MATlab
body: <p>I am trying to isolate specific sections of data in a <code>m x 4</code> matrix. There are tons of data points and I need to be able to isolate specific sections of the data in the matrix. </p>
  
  <p>To add to the problem I have 8 data sets that are identical in size (<code>m x 8</code>), each with different data values in them. Further, in each matrix of data, there is a break where there are 2 columns instead of 4.</p>
  
  <p>I need to figure out a way to read all the files in at once, isolate specific columns of the data in all 8 matrices, isolate the same section of data in all 8 matrices and then average the data into a single matrix.</p>
  
  <p>right now what I have is:</p>
  
  <pre><code>clear
  for n = 1:8
      raw = fileread(['filename',num2str(n)]); %num2str(n) is the test number which goes from 1-8
  end
  </code></pre>
  
  <p><em>Is there a shorter way to do this?</em></p>
  
  <p>The data looks like this:</p>
  
  <pre><code>  1000 50
    1 0.01 33.37 252.052
    2 0.03 24.43 302.95
    3 0.05 113.4 303.35
    4 0.07 36.93 301.36
    5 0.09 30.18 272.923
    6 0.11 21.73 311.392
    7 0.13 98.14 309.547
    8 0.15 57.99 307.23
    9 0.17 28.3 294.802
    10 0.19 25.87 315.202
    11 0.21 88.8 271.713
    12 0.23 65.62 286.422
    13 0.25 27.9 338.652
    14 0.27 27.5 323.503
    15 0.29 65.8 302.545
    16 0.31 85.68 288.909
    17 0.33 25.68 368.932
    18 0.35 28.1 372.731
    19 0.37 52.03 386.33
    20 0.39 104.95 402.87
    21 0.41 23.45 349.083
    22 0.43 30.31 353.418
    23 0.45 42.89 410.256
    24 0.47 109.12 421.674
    25 0.49 23.26 379.214
    26 0.51 35.76 343.582
    27 0.53 26.3 401.289
    28 0.55 118.04 434.815
    29 0.57 29.12 376.607
    30 0.59 33.58 424.887
    31 0.61 23.23 393.065
    32 0.63 107.01 394.063
    33 0.65 47.05 449.556
    34 0.67 25.2 347.347
    35 0.69 29.56 386.667
    36 0.71 93.81 310.077
    37 0.73 59.56 338.902
    38 0.75 26.5 257.647
    39 0.77 25.89 296.728
    40 0.79 75.37 284.466
    41 0.81 78.66 274.047
    42 0.83 28.25 263.322
    43 0.85 24.87 249.153
    44 0.87 58.41 294.226
    45 0.89 97.23 288.702
    46 0.91 22.02 313.901
    47 0.93 30.99 278.787
    48 0.95 37.59 331.611
    49 0.97 116.68 291.19
    50 0.99 21.89 277.714
    2000 50
    1 0.01 32.46 254.776
    2 0.03 23.79 323.679
    3 0.05 112.33 301.529
    4 0.07 37.24 318.256
    5 0.09 30.47 254.25
    6 0.11 23.79 307.803
    7 0.13 100.33 317.979
    8 0.15 54.73 308.255
    9 0.17 27.95 268.967
    10 0.19 26.2 314.853
    11 0.21 87.03 271.006
    12 0.23 66.81 289.273
    13 0.25 27.41 317.178
    14 0.27 27.33 321.76
    15 0.29 69.99 325.501
    16 0.31 82.7 287.062
    17 0.33 26.21 393.801
    18 0.35 28.07 373.959
    19 0.37 57.72 384.509
    20 0.39 99.11 395.208
    21 0.41 22.67 352.55
    22 0.43 30.84 363.797
    23 0.45 43.4 413.233
    24 0.47 108.33 420.134
    25 0.49 23.17 402.015
    26 0.51 36.52 340.785
    27 0.53 26.55 374.52
    28 0.55 120.69 422.856
    29 0.57 26.18 392.931
    30 0.59 33.7 428.731
    31 0.61 22.82 412.042
    32 0.63 105.36 407.581
    33 0.65 48.39 426.492
    34 0.67 26.35 356.509
    35 0.69 27.29 389.012
    36 0.71 90.77 303.742
    37 0.73 62.94 324.713
    38 0.75 27.02 273.747
    39 0.77 27.18 264.457
    40 0.79 71.91 293.905
    41 0.81 78.46 274.991
    42 0.83 28.82 272.619
    43 0.85 27.21 241.423
    44 0.87 54.81 285.661
    45 0.89 101.26 292.041
    46 0.91 22.54 317.539
    47 0.93 30.44 292.688
    48 0.95 39.77 326.761
    49 0.97 115.9 285.359
    50 0.99 21.04 296.302
  </code></pre>
  
  <p>the first column repeats after completing a 1-50 cycle and the second column repeats every 0.01-0.99
  I'm trying to isolate the data in each cycle and make it equal to a single variable that I can manipulate or graph.</p>