Please help. I need to read this file and isolate column 2.
Mostra commenti meno recenti
It appears the data is not separated into columns. Any way to do this?
A = importdata('Psmall.txt');
A1 = A(:,2);
5 Commenti
the cyclist
il 17 Mag 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
il 17 Mag 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
il 17 Mag 2018
the cyclist
il 17 Mag 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
il 18 Mag 2018
Risposta accettata
Più risposte (0)
Categorie
Scopri di più su Data Import and Analysis in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!