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

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);
must we use str2num?
Why do I get such a weird graph? Thanks I can plot the graph now

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

도움말 센터File Exchange에서 Language Support에 대해 자세히 알아보기

제품

태그

질문:

2015년 11월 21일

댓글:

2015년 11월 22일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by