Info

This question is closed. Reopen it to edit or answer.

Why does not textscan work with importing this?

1 view (last 30 days)
Christofer Eriksen
Christofer Eriksen on 3 Oct 2013
Closed: MATLAB Answer Bot on 20 Aug 2021
Hi all,
I have some logged data in a tab-separated .txt file with headers in first row, see attached file "torquedata.txt".
I have a short input script using textscan, which looks like this, called "read.m":
fid = fopen('torquedata.txt');
%data_text = textscan(fid, '%s %s %s %s %s %s', 1, 'Delimiter', '\t')
data = textscan(fid, '%f%f%f%f%f%f', 'Delimiter', '\t', 'headerlines', 1);
fclose(fid);
%
Can someone tell me why it only returns a 1x6cell "data" matrix with only the top left cell showing correct data?
>> run read >> data
data =
Columns 1 through 5
[3.4455e+09] [0x1 double] [0x1 double] [0x1 double] [0x1 double]
Column 6
[0x1 double]
Please assist, I would really appreciate it.

Answers (0)

Tags

Community Treasure Hunt

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

Start Hunting!