Azzera filtri
Azzera filtri

How can Specific line and column text file can be read in Matlab?

1 visualizzazione (ultimi 30 giorni)
Hello!
I want matlab to read the line 4 and column 10 of the attached text file. Kindly guide me how to read the specific line and column?
  1 Commento
Khan Muhammad Adeel Khan
Khan Muhammad Adeel Khan il 9 Lug 2020
Modificato: Khan Muhammad Adeel Khan il 9 Lug 2020
Thanks for the swift response. I want to save the 1st Quartile value 0.9681 in matlab format.

Accedi per commentare.

Risposte (1)

Takumi
Takumi il 10 Lug 2020
fname = 'sub1.txt';
fid = fopen(fname);
% skip 2 lines
for i=1:2
fgetl(fid);
end
str = fgetl(fid); % get specific line
fclose(fid);
num = extractBetween(str,":"," "); % extract numbers
str2num(cell2mat(num)) % convert

Categorie

Scopri di più su Migrate GUIDE Apps 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