melatonin15
melatonin15

Reputation: 2269

Reading numeric data from a text file to one column vector in Matlab

I have a text file a.text of the form

    2    3    4    
    1    5    6    

Now, I want to read this text file using Matlab and make a column vector b of the form :

b =

     2
     3
     4
     1
     5
     6

The original text file contains 100*100 numbers. Could anyone help?

Upvotes: 0

Views: 80

Answers (1)

Nishant
Nishant

Reputation: 2619

Use textread

b = textread('a.txt','%d'); 

Upvotes: 2

Related Questions