average precipitation for the entire data set in matlab

Assuming you have a precipitation data vector named precipitation, you can simply use the mean function in Matlab to calculate the average precipitation for the entire data set as follows:

main.m
average_precipitation = mean(precipitation);
45 chars
2 lines

This will give you a single value which represents the average precipitation for the entire data set.

related categories

gistlibby LogSnag