Reputation: 7237
I have this CSV data file that looks like
a,b
1,2
3,4
data = readdlm("my/local/path", ',')
however, when I access data[1]
, I'm only getting a
, I thought it supposes to be [a,b]
? Doing things like data[1:2]
gets me the first column only.
Any idea how can I access the second column?
Upvotes: 3
Views: 1258
Reputation: 5746
From the docs for readdlm:
Read a matrix from the source where each line gives one row...
So use data[row,col]
syntax to get each element
Upvotes: 3