Easiest way to skip a few lines and then read data from this text file ( x and y) to draw a plot.
11 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Malay Arya
le 22 Jan 2020
Commenté : Star Strider
le 24 Jan 2020
I have attached the file I'm trying to do this for.
Thanks a lot!
0 commentaires
Réponse acceptée
Star Strider
le 22 Jan 2020
Modifié(e) : Star Strider
le 22 Jan 2020
filename = '6in_nomass_5.txt';
Data = dlmread(filename, '\t', 6, 0);
There are others, such as readmatrix that are likely even easier, however you did not state the release you are using, so dlmread is a safe option.
EDIT — To draw the plot:
figure
plot(Data(:,1), Data(:,2))
grid
2 commentaires
Plus de réponses (1)
Jesus Sanchez
le 22 Jan 2020
From yout MATLAB: Home -> Variable -> Import data.
From there you can also create a function that will allow you to import future files.
Voir également
Catégories
En savoir plus sur Graphics Object Identification 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!