convert to monthly mean (arrange data)
Mostra commenti meno recenti
I attached here 2 text files ..one is input file(complete data of year,month number,Day1 to day31) and second one is output file(year, month wise mean).I want this output format only.
6 Commenti
Guillaume
il 22 Set 2014
What is the difficulty you're facing? Looks as simple as averaging column 3 onwards of each row.
skyhunt
il 22 Set 2014
Geoff Hayes
il 22 Set 2014
Start with importdata to load the data from each file into local variables (structures). The data field of each of these structures will have the numeric data. As some of your columns (for certain rows) are empty, then these will be replaced with NaN.
Then as Guillaume suggested, take the average of each row (only from the input.txt file) from the third column onwards. If you have the Statistics Toolbox, consider using nanmean which will take the average of a set of numbers, ignoring any Nan values. If you don't have this function, then you can write an equivalent version using mean as a guide.
skyhunt
il 23 Set 2014
Geoff Hayes
il 24 Set 2014
What happened when you loaded the data from file using importdata? Please post some or all of the code that you have written to accomplish this task.
Risposta accettata
Più risposte (0)
Categorie
Scopri di più su MATLAB in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!