How to read .csv files in MATLAB 2019a?
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Ivan Mich
am 23 Dez. 2019
Beantwortet: Walter Roberson
am 23 Dez. 2019
Sorry,
I have a problem with a command. In Matlab version 2015a I used to use commands
filename1= 'B_STAT.xlsx'
[d1,tex]= xlsread(filename1);
REAL_B=d1(:,3);
REAL_B=d1(:,4);
in order to open a file and separate columns. In 2019a version I am not allowded to use these commands: In command window shows me that : "Error in line 2"
Could someone help me in order to fix my problem?
0 Kommentare
Akzeptierte Antwort
Walter Roberson
am 23 Dez. 2019
Those are still valid commands in MATLAB.
However if you do not happen to be using MS Windows with Excel installed, then you would get a warning that "Basic" mode would be used, and it would try to find B_STAT.csv which probably does not exist.
You can use
d1 = readtable(filename1);
to do the reading. You might need
d1 = readtable(filename1, 'readvariablenames', false);
The result either way would be a table() object, and then
REAL_B = d1{:,3};
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Files and Folders finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!