one reason to dislike Matlab
Nov. 11th, 2008 10:05 pmArray indices start from 1, which means that to properly avoid fencepost errors, your code ends up looking like this:
Lots of extraneous 1s. (And that's because the data is nice: this code can't handle partial days)
I hear NumPy is a very good substitute.
for day=1:floor(size(p1,2)/24) %for each day
daytotal(day) = sum(p(24*(day-1)+1:24*(day-1)+24));
endLots of extraneous 1s. (And that's because the data is nice: this code can't handle partial days)
I hear NumPy is a very good substitute.