Importing Data from a TXT file
Ältere Kommentare anzeigen
I have successfully managed to read a text file containing a large number of values, however, I am unable to use these value in MATLAB. I think this is because in the array they have apostrophe's around the numbers, for example, '0.235659'.
The code I used to read the text file and store the values in an array is:
fid = fopen('Kap.PORO');
tline = fgetl(fid);
tlines=cell(0,1);
while ischar(tline)
%disp(tline)
tlines{end+1,1}=tline;
tline = fgetl(fid);
end
fclose(fid);
I was wondering if anyone knew how to either convert these into an array where I can use the values or a better way of storing values from a TXT file.
Thanks
1 Kommentar
If you simply upload your textfile using the paperclip button above the textbox, then we can try it for ourselves. This is much easier for everyone! You will need to push both the Choose file and Attach file buttons.
Akzeptierte Antwort
Weitere Antworten (0)
Kategorien
Mehr zu Text Data Preparation finden Sie in Hilfe-Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!