I need program to calculate and plot average values of per hour, day, month and seasonal.

1 回表示 (過去 30 日間)
Lamessa Tamasgen
Lamessa Tamasgen 2023 年 2 月 14 日
編集済み: Amit Dhakite 2023 年 3 月 16 日
I have 1440 data in one day. I want to convert hourly, daily, monthly and seasonal mean and plot it.
data = load('yea.dat');
Year=data(:,1);
Month=data(:,2);
Day=data(:,3);
UT=data(:,4);
vTEC = data(:,5);% Ave_vTEC_Obs (TECu)

回答 (1 件)

Amit Dhakite
Amit Dhakite 2023 年 3 月 15 日
編集済み: Amit Dhakite 2023 年 3 月 16 日
Hi Lamessa,
As per my understanding, you have some data "yea.dat" file, for which you want to find out mean of each column and plot its values.
For simplicity let's take random values and plot their mean values:
% To generate random values for 5 columns
Data = rand(1440, 5);
% To calculate mean of each column, second parameter "1" representing
% calculation of mean column-wise
Mean_Data = mean(Data, 1);
% To plot the calculated mean values
plot(Mean_Data);
To find out more about the functions used above, kindly go through the following links:
  1. rand(): https://www.mathworks.com/help/matlab/ref/rand.html
  2. mean(): https://www.mathworks.com/help/matlab/ref/mean.html
  3. plot(): https://www.mathworks.com/help/matlab/ref/plot.html

カテゴリ

Help Center および File ExchangeDates and Time についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by