How can Specific line and column text file can be read in Matlab?
5 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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 commentaire
Réponses (1)
Takumi
le 10 Juil 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
0 commentaires
Voir également
Catégories
En savoir plus sur Migrate GUIDE Apps dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!