Please help. I need to read this file and isolate column 2.
Ältere Kommentare anzeigen
It appears the data is not separated into columns. Any way to do this?
A = importdata('Psmall.txt');
A1 = A(:,2);
5 Kommentare
the cyclist
am 17 Mai 2018
Is there something wrong with doing it the way you just did? I'm pretty sure that just about any other method is going to take even more code to parse things the way you want.
Star Strider
am 17 Mai 2018
Your code as you posted it runs for me without errors (in R2018a) and gives the appropriate output.
A = importdata('Psmall.txt');
A0 = A(:,1);
A1 = A(:,2);
figure
scatter(A0, A1, '+')
grid
Charles Naegele
am 17 Mai 2018
the cyclist
am 17 Mai 2018
To be clear, when I run your code, I get an Nx2 matrix (of data type "double"). As Star Strider said, it is then easy to separate them into the column vector.
Is that what you get?
Charles Naegele
am 18 Mai 2018
Akzeptierte Antwort
Weitere Antworten (0)
Kategorien
Mehr zu Data Import and Analysis finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!