Please help. I need to read this file and isolate column 2.
이전 댓글 표시
It appears the data is not separated into columns. Any way to do this?
A = importdata('Psmall.txt');
A1 = A(:,2);
댓글 수: 5
the cyclist
2018년 5월 17일
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
2018년 5월 17일
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
2018년 5월 17일
the cyclist
2018년 5월 17일
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
2018년 5월 18일
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Data Import and Analysis에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!