store the second column of input.dat in a vector y in matlab

You can use the importdata function to read data from a file as a matrix, and then extract the second column to a vector using indexing. Here's an example code:

main.m
        ```
        data = importdata('input.dat');
        y = data(:, 2);
        ```

        `y` will be a column vector containing the values from the second column of `input.dat`.
186 chars
7 lines

related categories

gistlibby LogSnag