How to separate imported data from notepad to two separate columns ?
이전 댓글 표시
I have 2 columns of data from notepad. However, these 2 columns appear as a variable. I can't plot a graph using the data as I need to separate the 2 columns to x(1 column) and y(1 column) Thanks I am new to MATLAB I accidently accepted the answer for my previous question. I still dont know how to separate the columns
댓글 수: 4
Natalia Wong
2015년 11월 21일
Matthew Crema
2015년 11월 21일
편집: Matthew Crema
2015년 11월 21일
I think you have several lines of code that you don't need, and depending on the file you may be able read the data into MATLAB with one line of code. For example,
z = textread('badminton data.dat.txt')
but anyway once you have the data in MATLAB you should be able to separate the columns using the colon (:) operator.
For example,
x = z(:,1);
y = z(:,2);
Natalia Wong
2015년 11월 22일
Natalia Wong
2015년 11월 22일
답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Language Support에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!