Azzera filtri
Azzera filtri

Trouble reading number from file

8 visualizzazioni (ultimi 30 giorni)
Kris zenitis
Kris zenitis il 22 Lug 2014
Risposto: Azzi Abdelmalek il 22 Lug 2014
I am trying to read a txt file into an array. When I import the file mannually it opens normally into a desired 3000x10 matrix. When I am trying to user textread in order to import the data textread(data.txt) I am getting the following error:
Trouble reading number from file (row 1, field 2) ==> , 0.82477773784066744,
0.028192741339486998, 0
Error in ==> textread at 176
[varargout{1:nlhs}]=dataread('file',varargin{:});
  3 Commenti
Kris zenitis
Kris zenitis il 22 Lug 2014
0, 0.82477773784066744, 0.028192741339486998, 0.075278907139026061, 0, 0, 0, 0, 0, 0.034134401317307488
For example the above is the first line
Michael Haderlein
Michael Haderlein il 22 Lug 2014
I think dlmread is better suited for that file.

Accedi per commentare.

Risposte (1)

Azzi Abdelmalek
Azzi Abdelmalek il 22 Lug 2014
data=importdata('filename.txt')

Categorie

Scopri di più su Data Import and Analysis in Help Center e File Exchange

Tag

Community Treasure Hunt

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

Start Hunting!

Translated by