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!