Reading and plotting data
2 views (last 30 days)
Show older comments
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 Comment
Eric Sofen
on 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.
Answers (1)
Chunru
on 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 Comments
See Also
Categories
Find more on Dates and Time in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!