Reading and plotting data
2 ビュー (過去 30 日間)
古いコメントを表示
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 件のコメント
Eric Sofen
2022 年 9 月 21 日
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.
回答 (1 件)
Chunru
2022 年 9 月 21 日
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 件のコメント
参考
カテゴリ
Help Center および File Exchange で Dates and Time についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!