How could I extract a column within a timetable?
74 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Bella
il 21 Ago 2020
Risposto: Walter Roberson
il 21 Ago 2020
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 Commenti
Risposta accettata
Walter Roberson
il 21 Ago 2020
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 Commenti
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Scatter Plots in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!