I tried to import data from a text file. The data file format should be the first row are char and others are numbers, just like a xls file. But the file is generated by other software as a text file, where all data is in one row, with one space bar separated and 'tab' as a new row of data.
The data format I want to import into matlab should be like this:
A B C D
1 2 3 4
5 6 8 8
8 0 9 5
But now the data in the text file is
A B C D 1 2 3 4 5 6 8 8 8 0 9 5
How should I import the text file into the matlab in a matrix like please? I tried importdata but the ans is 4x1 cell. My Matlab version is 2008.
Sorry I am very new to matlab. Thank you.
Edited: I realized that the data is
A B C D 1 2 3 4 5 6 8 8 8 8 0 9 5 7 0 8 8 8 5 0 9 9
Would you please teach me how to put these things into the cell, with one char/number one cell please?
A B C D
1 2 3 4
5 6 8 8 8
8 0 9 5
7 0 8 8 8
5 0 9 9
Coz when i use cell2mat as suggested, error msg is CAT arguments dimensions are not consistent.
Thank you very much!
ìmportdataproduces a cell array. - bushmills