How to separate imported data from notepad to two separate columns ?
Afficher commentaires plus anciens
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 commentaires
Natalia Wong
le 21 Nov 2015
Matthew Crema
le 21 Nov 2015
Modifié(e) : Matthew Crema
le 21 Nov 2015
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
le 22 Nov 2015
Natalia Wong
le 22 Nov 2015
Réponses (0)
Catégories
En savoir plus sur Language Support dans Centre d'aide et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!