I have a text file which has 500 columns
and 500 rows
, of numerical(integer) values . Every element in the row is separated by a tab. I want to read this file as a matrix in matlab
. Example(my text file is like this):
1 2 2 1 1 2
0 0 0 1 2 0
1 2 2 1 1 2
0 0 0 1 2 0
And after reading this text file as a matrix (a[]
) in matlab I want to do transpose
.
Help me.
Have you tired
load
with-ascii
option?For example
You could simply do:
You can use
importdata
. Something like:You can skip headerlines if your file does not have any haeder.. (It is the number of lines before the actual data starts)
Taken from Matlab documentation, improtdata