how to load a txt file and create a matrix?
26 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
EM geo
le 22 Juil 2022
Réponse apportée : Walter Roberson
le 22 Juil 2022
Hi everybody!
I need to load the txt file attached and create a matrix in order to create boxplots. Can you help me ?
I tried this code I wrote for another purpose, but I don't know how to increase the number of rows and columns to import:
clear; clc; close;
fid = fopen('grad_all_er_v1.txt','rt');
C = textscan(fid, '%f%f%f', 'MultipleDelimsAsOne',true, 'Delimiter','[;', 'HeaderLines',2);
0 commentaires
Réponse acceptée
Walter Roberson
le 22 Juil 2022
The file uses comma as decimal point, which needs to be account for.
C = readmatrix('grad_all_er_v1.txt', 'Decimal', ',', 'treatas', '-9999');
This command also converts all those -9999 into nan.
0 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Large Files and Big Data 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!