Reading and plotting data
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
I've listed out the things that will help me get started with this data:
1. Read the Seismic data (use fopen, textscan, fclose functions)
only need up to the first 5 columns (ignore the rest using “%*[^\n]”)
2. Remove ‘z’ & ‘t’ contained in time column (use strrep function)
3. Convert dates into serial numbers (use datenum function)
4. Create scatter plot
Use datetick function to see dates on plot
I've searched which functions do the best for each job but I'm having touble implementing them.
The data file is attached
1 commentaire
Eric Sofen
le 21 Sep 2022
Note that you don't need to use datetick to display dates on a scatter plot any more. You can directly plot datetime or durations in most chart types.
Réponses (1)
Chunru
le 21 Sep 2022
x = readtable("https://www.mathworks.com/matlabcentral/answers/uploaded_files/1131005/Lab3.csv")
x.('datetime') = datetime(x.time, "InputFormat", "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'")
x = x(:, [end 2:5]) % select data
% try do the rest yourself
0 commentaires
Voir également
Catégories
En savoir plus sur Dates and Time 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!