0

I want to parse file in MatLab, the data in the text with this format.

15.01245  20.478
12.589  58.256

i used this function:

fid = fopen('file.txt');
tline = fgets(fid);
while ischar(tline)
disp(tline)
tline = fgets(fid);
end

fclose(fid);

It gave me the lines, but i want to extract it and store it as array like:

data(1,1)=15.01245 , data(1,2)= 20.478

how i can do that?

Thanks,

userInThisWorld
  • 1,361
  • 4
  • 18
  • 35

1 Answers1

2

Simply call to

data = load('file.txt')
masoud
  • 55,379
  • 16
  • 141
  • 208
Shmil The Cat
  • 4,548
  • 2
  • 28
  • 37