Assuming that the loaded data is stored in a matrix data, we can obtain the first column and second column as column vectors t and x respectively using the following code:
main.m123 chars3 lines
Here, : operator is used to select all rows, and 1 and 2 are the column indices indicating the first and second columns of the matrix data.
Note: If the loaded data file data.csv is a comma-separated file, we can use the following code to load the data:
main.m28 chars2 lines
This assumes that the file data.csv is in the current working directory of MATLAB. If the file is located in a different directory, we need to provide the full path to the file.
gistlibby LogSnag