How could I extract a column within a timetable?

74 次查看(过去 30 天)
I created a timetable. The first column is the timestamp, then followed by different variables measured over time. I want to plot a scatter plot by using the timestamp as my x-axis and a couple of other variables on my y-axis. I tried to convert my variables into a separate column out of the timetable so that I could call the vairables when plotting them with my timestamp. I tried to use splitvars to split my variables but it did not seem to work. Thanks!

采纳的回答

Walter Roberson
Walter Roberson 2020-8-21
x = YourTable.Properties.RowTimes;
y1 = YourTable.FirstInterestingVariable;
y2 = YourTable.SecondInterestingVariable;
pointsize = 15;
scatter(x, y1, pointsize, 'b')
hold on
scatter(x, y2, pointsize, 'r');
hold off
legend({'First Interesting Variable', 'Second Interesting Variable'});

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Scatter Plots 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by