- Read the data from the file into a matrix using ""readmatrix" function of MATLAB into a variable say "data".
- Create two new columns. The first column, named "label", should contain the string "Grid" repeated for each row of "data" and the second column should contain serial numbers from 1 to the number of rows in "data".
- Combine these new columns with the original data to form a new matrix.
- Write the updated matrix back to disk using "writematrix" function of MATLAB.
- doc readmatrix
- doc writematrix