Skip to main content
1-Visitor
February 2, 2011
Question

Help with Programming Maximum Function

  • February 2, 2011
  • 2 replies
  • 3493 views

I have a vector that represents monthly values for 30 years of data (i.e. 360 discrete values). I need to write a programming loop that finds the maximum value in each year. I'm having an issue setting up a counter on the "max" function. Any suggestions?

2 replies

19-Tanzanite
February 2, 2011

Please post a worksheet with the data and what you have so far.

amaurer1-VisitorAuthor
1-Visitor
February 2, 2011

A draft worksheet is attached.

19-Tanzanite
February 2, 2011

It's easier to do it by splitting out each year using the submatrix function.

amaurer1-VisitorAuthor
1-Visitor
February 2, 2011

That worked perfectly. I have never used the submatrix command, but I will now. Thanks for your help!