How to plot binned data from a table?

5 ビュー (過去 30 日間)
Olivia Hakan
Olivia Hakan 2023 年 2 月 2 日
回答済み: Steven Lord 2023 年 2 月 2 日
I am plotting data from text files that open as tables with columns of concentrations, and a column of date/times. I need to bin & plot the data in hourly averages & so I can look at diurnal cycles over the span of the month. Without much Matlab experience I'm struggling. Any help is appreciated!
Here is my code I've used to just plot the plain time series from 1/1-1/23.
T = readtimetable("summary_1_1_2023__1_23_2023.txt","TextType","string"); %opening table
hold on
plot(T.Time, T.Var46); %Time (date/time), Vanadium
plot(T.Time, T.Var52); %Time, Iron
plot(T.Time, T.Var58); %Time, Copper
legend('Vanadium', 'Iron', 'Copper');
title('Metal Aerosol Concentrations in January');
xlabel('Time passed (days)');
ylim([-0.05 3.5]);

回答 (1 件)

Steven Lord
Steven Lord 2023 年 2 月 2 日
Take a look at the "Aggregate Timetable Data and Calculate Mean Values" example on the retime documentation page.

カテゴリ

Help Center および File ExchangeLine Plots についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by