1

I have file dane.txt, how to read this in MATLAB ? Which function to use ? load() give me message about unequal number of columns in first and second row.

File Number; rho; B; drop probability
21; 0.30; 20; 0.00230906
21; 0.30; 30; 0.00150975
21; 0.30; 40; 0.00110355
Shai
  • 111,146
  • 38
  • 238
  • 371
Qbik
  • 5,885
  • 14
  • 62
  • 93

1 Answers1

3

Try looking at dlmread with delimiter ';', or textscan or importdata.

For example

 >> A = importdata('dane.txt')

A = 

      data: [3x4 double]
  textdata: {'File Number'  ' rho'  ' B'  ' drop probability'}
colheaders: {'File Number'  ' rho'  ' B'  ' drop probability'}

 >> A.data

ans =

 21.0000    0.3000   20.0000    0.0023
 21.0000    0.3000   30.0000    0.0015
 21.0000    0.3000   40.0000    0.0011
Shai
  • 111,146
  • 38
  • 238
  • 371