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!
0 个评论
采纳的回答
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 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Scatter Plots 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!