MATLAB: How to read values every number of rows in one column

read values every certain number of rows

Good day, I am working on very large number of data. When I imported the data it has been shown in one column with 398112 rows. The data is very 32 different variables such as depth, velocity .. etc. I want to read each variable separately so that I can plot it versus depth. Now, each parameter is repeated every 32 row for example Depth is repeated at rows 1, 33, 65 .. etc and velocity is repeated at rows 2, 34, 66 … etc. My question: How to read each parameter separately?

Best Answer

Rayed, You are very well set up in this situation. One of the best ways to do this is, if you check out the 'reshape' command, from your vector you can create a matrix with 32 rows and 398112/32 columns. Then each row of the matrix will contain the same parameter, and you can read out the rows as desired as M(row_number,:). It's never a bad idea to try this out with a small sample vector and matrix first.
Related Question