필터 지우기
필터 지우기

How to stack plot data yearly from a timetable

조회 수: 3 (최근 30일)
Tomas Miguieles
Tomas Miguieles 2020년 7월 8일
댓글: Yazan 2021년 8월 7일
I'm running Matlab R2020a. I have a 81033×4 timetable with the first column being the timestamp column, the second column the timestring, and columns 3,4 the columns holding y-values for each timestamp. The set of data goes from 2010 to 2020. I would like to plot time vs both y-values in a single plot for each year of data. I know there's tedious ways to do it using "plot" command, but I'm trying to get a nice figure with 10 plots (one for each year) using the commands "tiledlayout" or "stackedplot". In addition, the x and y labels are the same and the legend is the same for all yearly plots ('Top' & 'Bottom')
Some of the first lines I'm using:
tbl = readtable('mytable.csv');
tbl = table2timetable(tbl);
tbl1 = tbl(:,2:3);
vars = tbl1.Properties.VariableNames;
vars =
1×2 cell array
{'Bottom'} {'Top'}
  댓글 수: 3
Roberto Chang
Roberto Chang 2021년 8월 7일
Hello, I am facing the sam need, did anyone help you?
Yazan
Yazan 2021년 8월 7일
It's better if you upload your data.

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Line Plots에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by