Issues with importdata function

2 次查看(过去 30 天)
Andreas Westergaard
Andreas Westergaard 2012-11-13
Hi. I have a number of tab-delimited ascii files with 3 lines of header:
xcoord: 1234 ycoord: 1235 data_sf 34 53 64 36 15 135 235 25 25 43
I want to import the files and do some calculations on the data without affecting the header. I therefor used the "importdata" function, with added info about the ascii-files:
result=importdata(filename,'\t',3)
which resulted in a 1x1 struct describing the matrix size and data type of data and textdata respectively. How do I access the data? If I import the ascii-file manually via the File->Import Data wizard, I get a variable named data and textdata in my workspace window. How can I get that with the importdata-function? Thanks in advance for inputs
  1 个评论
Andreas Westergaard
Andreas Westergaard 2012-11-13
Ah, I had to extract the right matrix from the struct. So I had to write:
result=importdata(filename.data, '\t',3)
problem solved

请先登录,再进行评论。

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Workspace Variables and MAT-Files 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by