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 Comments

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

Sign in to comment.

Answers (0)

Products

Asked:

on 21 Nov 2015

Commented:

on 22 Nov 2015

Community Treasure Hunt

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

Start Hunting!