csvread reading only column or full matrice in 2015a / b
1 view (last 30 days)
Show older comments
Hi !
I am currently triing to code something which would import ( or read in this case ) some csv files I have which look like this and which are 1024*1024.

I am working on two computers, one with Matlab 2015a, the other one with 2015b.
When I simply type in Matlab 2015a the code :
A = csvread ('file.txt')
I get an A matrice which is 1024*1024 ( as expected ). But when I type the same line, for the same file, in the same folder, on Matlab 2015b , I get an A matrice which is 1024*1.
And when I inserted in Matlab 2015a this line of code into a script, I then obtained the 1024*1 matrice ! I must say that I am now completely confused, as I never detailled in the code earlier something about importing only specifics rows/columns or whatever.
Do you have an idea about this issue ?
Thank you very much.
0 Comments
Accepted Answer
Walter Roberson
on 6 Jan 2016
csvread() is for comma separated values; what you show is either space separated or tab separated.
If it is space separated then you can use
A = load('file.txt', '-ascii');
More Answers (0)
See Also
Categories
Find more on Matrix Indexing in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!