How to read pairs of data from a text file?

I have a few output text files arranged in one row, each pair of data is (x1,x2) i.e:
-0.00049249 0.000252263 0.000674042 0.000829539 0.000820268 -0.00049555 ...
how can I put it in two columns Xodd Xpar like this:
-0.00049249 0.000252263
0.000674042 0.000829539
0.000820268 -0.00049555
. .
I'm a new user, I'll appreciate any help. Ty in advance

 Accepted Answer

A=[-0.00049249 0.000252263 0.000674042 0.000829539 0.000820268 -0.00049555]
B=reshape(A,2,[])'
To read your text file you can use dlmread
A=dlmread('your_file.txt')

More Answers (0)

Categories

Find more on Data Import and Analysis in Help Center and File Exchange

Tags

Asked:

on 9 Feb 2014

Commented:

on 10 Feb 2014

Community Treasure Hunt

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

Start Hunting!