Hello friends,
I have drawn to give better understanding of problem and also detailely explained below. If any one of you know possible solution that I missed, please feel free to let me know and if I lissed anything please feel fre to ask me.
Problem Definition:
I had a variable named Interpreted_power_1st_column = 105120 X 1 ;
- This is the power availablitiy data at a location collected at every 5 mins interval for whole year.( 8760*12=105120) (there are 12 5 mins intervals in 1 hour ,and 8760 hours in 365 days)
- I want the data to be avaerged to 1 hour interval, so I used reshape function in matlab( code below) to sum the 12 consequtive data points multiply by 5 and then divide the whole summation by 60....this is actually good way to get average data for 1 hour interval.
hourly_wind_energy1=zeros(8750,1);
hourly_wind_energy1=((sum(reshape(Interpreted_power*5,12,8760)))/60);
hourly_wind_energy1=hourly_wind_energy1';
Now I have to do the same but Interpreted_power = 105120 X 5 (5 columns)
I have be trying various ways like for loops but couldnot achieve my final result.
Possible solution 1 : any experts who are well aware of reshape function help me with a possible way to do the process I have done in problem definityin for an variable with several columns (for now 105120 X 5, 5 columns)
Possible solution 2:
- to create 5 different variables (Interpreted_power_1st_column, Interpreted_power_2nd_column, Interpreted_power_3rd_column, Interpreted_power_4th_column, Interpreted_power_5th_column)
- Interpreted_power_1st_column has 1st column of Interpreted_power = 105120 X 5
- Interpreted_power_2nd_column has 2nd column of Interpreted_power = 105120 X 5
- Interpreted_power_3rd_column has 3rd column of Interpreted_power = 105120 X 5
- Interpreted_power_4th_column has 4th column of Interpreted_power = 105120 X 5
- Interpreted_power_5th_column has 5th column of Interpreted_power = 105120 X 5
Now follow the same procedure used in Problem definition ( Use reshape function 5 times for 5 of these variables, then combine all the results into single variable with 8760 X 5 )
Problem with solution 2 : I am having trouble creating individual column variables,
Interpreted_power_1st_column=Interpreted_power(1:end);
Interpreted_power_1st_column=Interpreted_power_1st_column';
Interpreted_power_2st_column=Interpreted_power(2:end);
Interpreted_power_2st_column=Interpreted_power_2st_column';
Interpreted_power_3st_column=Interpreted_power(3:end);
Interpreted_power_3st_column=Interpreted_power_3st_column';
Interpreted_power_4st_column=Interpreted_power(4:end);
Interpreted_power_4st_column=Interpreted_power_4st_column';
Interpreted_power_5st_column=Interpreted_power(5:end);
Interpreted_power_5st_column=Interpreted_power_5st_column';
Thanks in advance